[Jifty-commit] r1701 - in jifty/trunk: t/TestApp-Plugin-REST/t

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sat Jul 29 01:03:23 EDT 2006


Author: jesse
Date: Sat Jul 29 01:03:22 2006
New Revision: 1701

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/t/TestApp-Plugin-REST/t/02-basic-use.t

Log:
 r14619 at pinglin:  jesse | 2006-07-28 21:58:47 -0700
 * Next REST Test pass


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 Jul 29 01:03:22 2006
@@ -24,9 +24,12 @@
 my $URL     = $server->started_ok;
 my $mech    = Jifty::Test::WWW::Mechanize->new();
 
-
 ok(1, "Loaded the test script");
 
+my $u1 = TestApp::Plugin::REST::Model::User->new(
+    current_user => TestApp::Plugin::REST::CurrentUser->superuser );
+$u1->create( name => 'jesse', email => 'audreyt at audreyt.org' );
+ok( $u1->id );
 
 # on GET    '/=/model'       => \&list_models;
 
@@ -51,11 +54,21 @@
 
 
 $mech->get_ok('/=/model/User');
-my @keys =  @{get_content()};
+my %keys =  %{get_content()};
+
+is (keys %keys, 4, "The model has 4 keys");
+is ((sort keys %keys), qw/id name email tasty/);
 
 
 # on GET    '/=/model/*/*'   => \&list_model_items;
+$mech->get_ok('/=/model/user/id');
+my @rows = @{get_content()};
+is ($#rows,1);
+
+
 # on GET    '/=/model/*/*/*' => \&show_item;
+$mech->get_ok('/=/model/user/id/1');
+my %content = %{get_content()};
 # on PUT    '/=/model/*/*/*' => \&replace_item;
 # on DELETE '/=/model/*/*/*' => \&delete_item;
 # on GET    '/=/action'      => \&list_actions;


More information about the Jifty-commit mailing list