[Jifty-commit] r1797 - jifty/trunk/t/TestApp-Plugin-REST/t

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sat Aug 12 12:52:07 EDT 2006


Author: nelhage
Date: Sat Aug 12 12:52:07 2006
New Revision: 1797

Modified:
   jifty/trunk/t/TestApp-Plugin-REST/t/02-basic-use.t

Log:
TODO'ing the failing tests that we're waiting for audrey to implement

Modified: jifty/trunk/t/TestApp-Plugin-REST/t/02-basic-use.t
==============================================================================
--- jifty/trunk/t/TestApp-Plugin-REST/t/02-basic-use.t	(original)
+++ jifty/trunk/t/TestApp-Plugin-REST/t/02-basic-use.t	Sat Aug 12 12:52:07 2006
@@ -14,7 +14,7 @@
 use lib 't/lib';
 use Jifty::SubTest;
 
-use Jifty::Test tests => 52;
+use Jifty::Test tests => 60;
 use Jifty::Test::WWW::Mechanize;
 
 my $server  = Jifty::Test->make_server;
@@ -120,12 +120,19 @@
 $mech->get_ok('/=/action/DoSomething.yml');
 is($mech->status, 200);
 
-
-my %args = %{get_content()};
-
-ok($args{email}, "Action has an email parameter");
-is($args{email}{label}, 'Email', 'email has the correct label');
-is($args{email}{default}, 'email at example.com', 'email has the correct default');
+TODO: {
+    local $TODO = "Waiting for YAML parameter lists for action";
+    my %args;
+
+    # Eval so this doesn't blow up if get_content doesn't return a hashref
+    eval {
+        %args = %{get_content()};
+    };
+
+    ok($args{email}, "Action has an email parameter");
+    is($args{email}{label}, 'Email', 'email has the correct label');
+    is($args{email}{default}, 'email at example.com', 'email has the correct default');
+}
 
 
 # on POST   '/=/action/*'    => \&run_action;
@@ -135,30 +142,42 @@
 
 $mech->content_contains('Something happened!');
 
-$mech->post( $URL . '/=/action/DoSomething', { email => 'bad at email.com' } );
+TODO: {
+    $mech->post( $URL . '/=/action/DoSomething', { email => 'bad at email.com' } );
 
-$mech->content_contains('Bad looking email');
-$mech->content_lacks('Something happened!');
+    local $TODO = "Waiting for actions to return validation errors";
+    $mech->content_contains('Bad looking email');
+    $mech->content_lacks('Something happened!');
 
-$mech->post( $URL . '/=/action/DoSomething', { email => 'warn at email.com' } );
-
-$mech->content_contains('Warning for email');
-$mech->content_contains('Something happened!');
+    $mech->post( $URL . '/=/action/DoSomething', { email => 'warn at email.com' } );
+    
+    $mech->content_contains('Warning for email');
+    $mech->content_contains('Something happened!');
+}
 
 # Test YAML posts
-yaml_post( $URL . '/=/action/DoSomething.yml', { email => 'good at email.com' } );
-
-%content = %{get_content()};
+TODO: {
+    local $TODO = "Waiting for YAML posts to work right";
+    
+    yaml_post( $URL . '/=/action/DoSomething.yml', { email => 'good at email.com' } );
 
-ok($content{success});
-is($content{message}, 'Something happened');
+    eval {
+        %content = %{get_content()};
+    };
 
-yaml_post( $URL . '/=/action/DoSomething', { email => 'bad at email.com' } );
+    ok($content{success});
+    is($content{message}, 'Something happened');
 
-%content = %{get_content()};
+    
+    yaml_post( $URL . '/=/action/DoSomething', { email => 'bad at email.com' } );
 
-ok(!$content{success});
-is($content{error}, 'Bad looking email');
+    eval {
+        %content = %{get_content()};
+    };
+
+    ok(!$content{success});
+    is($content{error}, 'Bad looking email');
+};
 
 
 sub get_content { return Jifty::YAML::Load($mech->content)}


More information about the Jifty-commit mailing list