[Jifty-commit] r2463 - in jifty/trunk: t/TestApp/t

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Fri Jan 5 00:31:21 EST 2007


Author: trs
Date: Fri Jan  5 00:31:10 2007
New Revision: 2463

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/t/TestApp/t/06-validation.t

Log:
 r18667 at zot:  tom | 2007-01-05 00:29:11 -0500
 TODO tests attempting to test if we get ajax validation errors for mandatory values after the sticky_value has been deleted


Modified: jifty/trunk/t/TestApp/t/06-validation.t
==============================================================================
--- jifty/trunk/t/TestApp/t/06-validation.t	(original)
+++ jifty/trunk/t/TestApp/t/06-validation.t	Fri Jan  5 00:31:10 2007
@@ -5,7 +5,7 @@
 use lib 't/lib';
 use Jifty::SubTest;
 
-use Jifty::Test tests => 14;
+use Jifty::Test tests => 22;
 use Jifty::Test::WWW::Mechanize;
 
 my $server  = Jifty::Test->make_server;
@@ -42,3 +42,21 @@
     " ... canonicalizer returned all lower case (good)");
 $mech->content_contains('<canonicalization_note id="canonicalization_note-J:A:F-email-dosomething">Lowercased your email</canonicalization_note>',
     " ... canonicalizer warned user");
+
+$mech->get_ok("$URL/dosomethingelse");
+$mech->fill_in_action_ok('dosomething',
+    'foo' => 'something',
+    'bar' => '',
+);
+$mech->submit_html_ok();
+$mech->content_contains('<span class="error text  argument-bar" id="errors-J:A:F-bar-dosomething">You need to fill in this field</span>', 'got error for bar');
+$mech->content_contains('<span class="error text  argument-foo" id="errors-J:A:F-foo-dosomething"></span>', 'got no error for foo');
+
+$mech->get_ok("$URL/__jifty/validator.xml?J:A-dosomething=TestApp::Action::DoSomethingElse&J:A:F-foo-dosomething=&J:A:F-bar-dosomething=blam&J:VALIDATE=1&_=",
+    "Getting validator.xml output for a form entry");
+$mech->content_lacks('<error id="errors-J:A:F-bar-dosomething">', " ... validator didn't return error for bar");
+
+TODO: {
+local $TODO = "Not implemented in Jifty yet";
+$mech->content_contains('<error id="errors-J:A:F-foo-dosomething">You need to fill in this field</error>', " ... validator returned error for foo");
+};


More information about the Jifty-commit mailing list