[Jifty-commit] r1431 - in wifty: trunk/t

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sat Jul 1 16:36:14 EDT 2006


Author: nelhage
Date: Sat Jul  1 16:36:12 2006
New Revision: 1431

Added:
   wifty/trunk/t/0-test-database.t   (contents, props changed)
Modified:
   wifty/   (props changed)

Log:
 r13513 at phanatique:  nelhage | 2006-06-30 15:53:55 +0200
 Test the users created in Wifty::Test


Added: wifty/trunk/t/0-test-database.t
==============================================================================
--- (empty file)
+++ wifty/trunk/t/0-test-database.t	Sat Jul  1 16:36:12 2006
@@ -0,0 +1,35 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+=head1 DESCRIPTION
+
+Test the models set up by L<Wifty::Test>
+
+=cut
+
+use Wifty::Test no_plan => 1;
+
+my $admin = Wifty::CurrentUser->superuser;
+
+my $users = Wifty::Model::UserCollection->new(current_user => $admin);
+isa_ok($users, 'Wifty::Model::UserCollection');
+
+$users->unlimit;
+
+is($users->count, 2, "Got two users");
+
+my $user = $users->next;
+
+isa_ok($user, 'Wifty::Model::User');
+is($user->name, 'Some User', 'name ok');
+is($user->email, 'someuser at localhost', 'email ok');
+ok($user->password_is('sekrit'), 'password ok');
+is($user->email_confirmed, '1');
+
+$user = $users->next;
+isa_ok($user, 'Wifty::Model::User');
+is($user->name, 'Other User', 'name ok');
+is($user->email, 'otheruser at localhost', 'email ok');
+ok($user->password_is('motdepasse'), 'password ok');
+is($user->email_confirmed, '1');


More information about the Jifty-commit mailing list