[Jifty-commit] r2891 - in jifty/branches/template-declare: . t/TestApp-Plugin-PasswordAuth/t

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sat Mar 3 12:55:44 EST 2007


Author: jesse
Date: Sat Mar  3 12:55:32 2007
New Revision: 2891

Modified:
   jifty/branches/template-declare/   (props changed)
   jifty/branches/template-declare/t/TestApp-Plugin-PasswordAuth/lib/TestApp/Plugin/PasswordAuth/Model/User.pm
   jifty/branches/template-declare/t/TestApp-Plugin-PasswordAuth/t/00-model-User.t

Log:
 r52893 at pinglin:  jesse | 2007-03-02 18:55:00 +0000
 * still-failing tests for model validator and canonicalizer calbacks


Modified: jifty/branches/template-declare/t/TestApp-Plugin-PasswordAuth/lib/TestApp/Plugin/PasswordAuth/Model/User.pm
==============================================================================
--- jifty/branches/template-declare/t/TestApp-Plugin-PasswordAuth/lib/TestApp/Plugin/PasswordAuth/Model/User.pm	(original)
+++ jifty/branches/template-declare/t/TestApp-Plugin-PasswordAuth/lib/TestApp/Plugin/PasswordAuth/Model/User.pm	Sat Mar  3 12:55:32 2007
@@ -11,6 +11,8 @@
 };
 
 use Jifty::Plugin::User::Model::User;
+use TestApp::Plugin::FavoriteColor;
+use TestApp::Plugin::FasterSwallow;
 use Jifty::Plugin::Authentication::Password::Model::User 'password_is';
 
 # Your model-specific methods go here.

Modified: jifty/branches/template-declare/t/TestApp-Plugin-PasswordAuth/t/00-model-User.t
==============================================================================
--- jifty/branches/template-declare/t/TestApp-Plugin-PasswordAuth/t/00-model-User.t	(original)
+++ jifty/branches/template-declare/t/TestApp-Plugin-PasswordAuth/t/00-model-User.t	Sat Mar  3 12:55:32 2007
@@ -23,6 +23,8 @@
 my $o = TestApp::Plugin::PasswordAuth::Model::User->new(current_user => $system_user);
 my ($id) = $o->create( name => 'jesse',
                        username => 'jrv',
+                       color => 'yellow',
+                       swallow_type => 'african',
                        password => 'secret');
 ok($id, "User create returned success");
 ok($o->id, "New User has valid id set");
@@ -34,3 +36,22 @@
 ok(!$o->password, "Can't get the password");
 can_ok($o,'set_password');
 ok($o->password_is( 'secret'));
+is($o->color, 'yellow');
+is ($o->swallow_type, 'african');
+
+
+my $p = TestApp::Plugin::PasswordAuth::Model::User->new(current_user => $system_user);
+ ($id) = $p->create( name => 'jesse2',
+                       username => 'jrv2',
+                       color => 'blue',
+                       swallow_type => 'african',
+                       password => 'secret');
+ok(!$p, "Users can't be created with the wrong favorite color");
+
+my $q = TestApp::Plugin::PasswordAuth::Model::User->new(current_user => $system_user);
+($id) = $p->create( name => 'jesse2',
+                       username => 'jrv2',
+                       color => 'yellow',
+                       swallow_type => 'european',
+                       password => 'secret');
+ok(!$q, "Users can't be created if they don't know african swallow_types are faster");


More information about the Jifty-commit mailing list