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

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sun Jul 30 03:46:03 EDT 2006


Author: audreyt
Date: Sun Jul 30 03:46:03 2006
New Revision: 1708

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

Log:
* Update the REST plugin tests to match.

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	Sun Jul 30 03:46:03 2006
@@ -14,7 +14,7 @@
 use lib 't/lib';
 use Jifty::SubTest;
 
-use Jifty::Test tests => 24;
+use Jifty::Test tests => 27;
 use Jifty::Test::WWW::Mechanize;
 
 my $server  = Jifty::Test->make_server;
@@ -28,7 +28,7 @@
 
 my $u1 = TestApp::Plugin::REST::Model::User->new(
     current_user => TestApp::Plugin::REST::CurrentUser->superuser );
-$u1->create( name => 'jesse', email => 'audreyt at audreyt.org' );
+$u1->create( name => 'test', email => 'test at example.com' );
 ok( $u1->id );
 
 # on GET    '/=/model'       => \&list_models;
@@ -51,7 +51,6 @@
 is($mech->status,'200');
 
 {
-    local $TODO = 'proper error code';
     $mech->get('/=/model/Usery');
     is($mech->status,'404');
 }
@@ -73,6 +72,12 @@
 # on GET    '/=/model/*/*/*' => \&show_item;
 $mech->get_ok('/=/model/user/id/1.yml');
 my %content = %{get_content()};
+is_deeply(\%content, { name => 'test', email => 'test at example.com', id => 1, tasty => undef });
+
+# on GET    '/=/model/*/*/*/*' => \&show_item_Field;
+$mech->get_ok('/=/model/user/id/1/email.yml');
+is(get_content(), 'test at example.com');
+
 # on PUT    '/=/model/*/*/*' => \&replace_item;
 # on DELETE '/=/model/*/*/*' => \&delete_item;
 # on GET    '/=/action'      => \&list_actions;


More information about the Jifty-commit mailing list