[Jifty-commit] r4959 - jifty/branches/jquery/t/TestApp-JiftyJS/t

Jifty commits jifty-commit at lists.jifty.org
Tue Jan 29 06:56:17 EST 2008


Author: gugod
Date: Tue Jan 29 06:56:10 2008
New Revision: 4959

Modified:
   jifty/branches/jquery/t/TestApp-JiftyJS/t/6-offer-actions.t

Log:
ADd another set of test to ensure a checked checkbox param 
remains checked.


Modified: jifty/branches/jquery/t/TestApp-JiftyJS/t/6-offer-actions.t
==============================================================================
--- jifty/branches/jquery/t/TestApp-JiftyJS/t/6-offer-actions.t	(original)
+++ jifty/branches/jquery/t/TestApp-JiftyJS/t/6-offer-actions.t	Tue Jan 29 06:56:10 2008
@@ -10,7 +10,11 @@
 
 
 $/ = undef;
-my @commands = split /\n\n/, <DATA>;
+
+my $data = <DATA>;
+$data =~ s/^#.*$//gm;
+
+my @commands = split /\n\n+/, $data;
 
 plan tests => 2+ at commands;
 
@@ -21,17 +25,14 @@
 for (@commands) {
     my ($cmd, $arg1, $arg2) = (split(/\n\s*/, $_, 3), "", "");
 
-    if ($cmd eq 'verify_text') {
-        $arg2 =~ s/\s*$//;
-        $arg2 =~ s/^\s*//;
-
-        my $txt = $sel->get_text($arg1);
-        is($txt, $arg2);
-    }
-    else {
-        $cmd .= "_ok";
-        $sel->$cmd($arg1, $arg2);
-    }
+    $cmd =~ s{^ *}{}g;
+    $cmd =~ s{ *$}{}g;
+    $arg1 =~ s{\s*$}{};
+    $arg2 =~ s{\s*$}{};
+
+    $cmd .= "_ok";
+    $sel->$cmd($arg1, $arg2);
+
 }
 $sel->stop;
 
@@ -40,14 +41,11 @@
     /__jifty/admin/model/Offer
 
 type
-    xpath=//div[contains(@class, "jifty_admin create item")]//input[contains(@type, "text")]
+    xpath=//div[contains(@class, "jifty_admin create item")]//input[@type="text"]
     Not A Job Offer
 
 click
-    xpath=//div[contains(@class,"submit_button")]/input
-
-pause
-    1000
+    xpath=//div[contains(@class,"submit_button")]//input
 
 wait_for_text_present
     Not A Job Offer
@@ -56,8 +54,30 @@
     xpath=//span[contains(@class, "text argument-name value")]
 
 wait_for_element_present
-    xpath=//input[@type="checkbox"][@disabled="disabled"]
+    xpath=//input[@type="checkbox"][contains(@class, "argument-is_job")]
 
 get_text
     xpath=//span[contains(@class, "text argument-name value")]
     Not A Job Offer
+
+####
+
+open
+    /__jifty/admin/model/Offer
+
+type
+    xpath=//div[contains(@class, "form_field argument-name")]//input[@type="text"]
+    Offer A Job
+
+check
+    xpath=//input[starts-with(@id, "J:A:F-is_job-auto-")][@type="checkbox"]
+
+click
+    xpath=//input[@type="submit"][@value="Create"]
+
+wait_for_element_present
+    xpath=//input[@type="checkbox"][@checked]
+
+get_text
+    xpath=//span[contains(@class, "text argument-name value")]
+    Offer A Job


More information about the Jifty-commit mailing list