[Jifty-commit] r1698 - in jifty/trunk: . t/TestApp-Plugin-REST/etc

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sat Jul 29 00:24:33 EDT 2006


Author: jesse
Date: Sat Jul 29 00:24:32 2006
New Revision: 1698

Added:
   jifty/trunk/t/TestApp-Plugin-REST/etc/
   jifty/trunk/t/TestApp-Plugin-REST/etc/config.yml
   jifty/trunk/t/TestApp-Plugin-REST/t/02-basic-use.t   (contents, props changed)
Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/t/TestApp-Plugin-REST/t/00-model-User.t
   jifty/trunk/t/TestApp-Plugin-REST/t/00-prototype.t
   jifty/trunk/t/TestApp-Plugin-REST/t/01-config.t

Log:
 r14611 at pinglin:  jesse | 2006-07-28 21:23:41 -0700
 * First tests!


Added: jifty/trunk/t/TestApp-Plugin-REST/etc/config.yml
==============================================================================
--- (empty file)
+++ jifty/trunk/t/TestApp-Plugin-REST/etc/config.yml	Sat Jul 29 00:24:32 2006
@@ -0,0 +1,3 @@
+framework:
+    Plugins:
+        - REST: {}

Modified: jifty/trunk/t/TestApp-Plugin-REST/t/00-model-User.t
==============================================================================
--- jifty/trunk/t/TestApp-Plugin-REST/t/00-model-User.t	(original)
+++ jifty/trunk/t/TestApp-Plugin-REST/t/00-model-User.t	Sat Jul 29 00:24:32 2006
@@ -8,6 +8,8 @@
 
 =cut
 
+use lib 'plugins/REST/lib';
+
 use lib 't/lib';
 use Jifty::SubTest;
 

Modified: jifty/trunk/t/TestApp-Plugin-REST/t/00-prototype.t
==============================================================================
--- jifty/trunk/t/TestApp-Plugin-REST/t/00-prototype.t	(original)
+++ jifty/trunk/t/TestApp-Plugin-REST/t/00-prototype.t	Sat Jul 29 00:24:32 2006
@@ -9,6 +9,7 @@
 
 =cut
 
+use lib 'plugins/REST/lib';
 use lib 't/lib';
 use Jifty::SubTest;
 

Modified: jifty/trunk/t/TestApp-Plugin-REST/t/01-config.t
==============================================================================
--- jifty/trunk/t/TestApp-Plugin-REST/t/01-config.t	(original)
+++ jifty/trunk/t/TestApp-Plugin-REST/t/01-config.t	Sat Jul 29 00:24:32 2006
@@ -2,6 +2,8 @@
 use strict;
 use warnings;
 
+use lib 'plugins/REST/lib';
+
 #use Jifty::Test tests => 3;
 use Jifty::Test tests => 1;
 

Added: jifty/trunk/t/TestApp-Plugin-REST/t/02-basic-use.t
==============================================================================
--- (empty file)
+++ jifty/trunk/t/TestApp-Plugin-REST/t/02-basic-use.t	Sat Jul 29 00:24:32 2006
@@ -0,0 +1,50 @@
+#!/usr/bin/env perl
+
+use warnings;
+use strict;
+
+=head1 DESCRIPTION
+
+This is a template for your own tests. Copy it and modify it.
+
+=cut
+
+use lib 'plugins/REST/lib';
+
+use lib 't/lib';
+use Jifty::SubTest;
+
+use Jifty::Test tests => 6;
+use Jifty::Test::WWW::Mechanize;
+
+my $server  = Jifty::Test->make_server;
+
+isa_ok($server, 'Jifty::Server');
+
+my $URL     = $server->started_ok;
+my $mech    = Jifty::Test::WWW::Mechanize->new();
+
+
+ok(1, "Loaded the test script");
+
+
+# on GET    '/=/model'       => \&list_models;
+
+$mech->get_ok("$URL/=/model.yml", "Got model list");
+my $list = Jifty::YAML::Load($mech->content);
+is(scalar @$list, 1, "Got one model");
+is($list->[0],'TestApp::Plugin::REST::Model::User');
+
+# on GET    '/=/model/*'     => \&list_model_keys;
+# on GET    '/=/model/*/*'   => \&list_model_items;
+# on GET    '/=/model/*/*/*' => \&show_item;
+# on PUT    '/=/model/*/*/*' => \&replace_item;
+# on DELETE '/=/model/*/*/*' => \&delete_item;
+# on GET    '/=/action'      => \&list_actions;
+# on GET    '/=/action/*'    => \&list_action_params;
+# on POST   '/=/action/*'    => \&run_action;
+# 
+
+
+1;
+


More information about the Jifty-commit mailing list