Permalink
Browse files

Had to remove controller tests for RecentChanges, because there is now

(correctly) a dynamic element -- the date the page was rendered.  In
general, we need to think deeply about how to test the controller.  It's
nice to have the tests, but the brute force method is of limited value,
and we've already crossed their shortcomings several times.

Also added some tests for the new set/getPassword methods for
PurpleWiki::User.
  • Loading branch information...
1 parent 0e50b88 commit 3decba9b8b7453ddc5ad6edfe224a5bddc467055 eekim committed Oct 10, 2005
Showing with 11 additions and 5 deletions.
  1. +2 −2 t/runwikMod.t
  2. +2 −2 t/runwiki.t
  3. +7 −1 t/userdb.t
View
4 t/runwikMod.t
@@ -5,7 +5,7 @@ $^W = 0;
require "t/runlog.pl";
require "t/runTest.pl";
-BEGIN { plan tests => 85 };
+BEGIN { plan tests => 83 };
END {
system('cp t/config.tDef t/config');
system('cp -r t/rDB t/useModDB');
@@ -28,7 +28,7 @@ local (*OUT);
open(OUT, ">&STDOUT") || die "Error open $!\n";
my ($test_in, $test_out, $compare);
- for my $seq (0..84) {
+ for my $seq (0..43, 45..52, 54..84) {
$test_in = "$testdir/request.$seq";
$test_out = "$testdir/test.$seq.html";
$compare = "$testdir/wiki.$seq.html";
View
4 t/runwiki.t
@@ -5,7 +5,7 @@ $^W = 0;
require "t/runlog.pl";
require "t/runTest.pl";
-BEGIN { plan tests => 85 };
+BEGIN { plan tests => 83 };
END {
system('cp t/config.tDef t/config');
system('rm -fr t/rDB');
@@ -27,7 +27,7 @@ local (*OUT);
open(OUT, ">&STDOUT") || die "Error open $!\n";
my ($test_in, $test_out, $compare);
- for my $seq (0..84) {
+ for my $seq (0..43, 45..52, 54..84) {
$test_in = "$testdir/request.$seq";
$test_out = "$testdir/test.$seq.html";
$compare = "$testdir/wiki.$seq.html";
View
8 t/userdb.t
@@ -3,7 +3,7 @@
use strict;
use Test;
-BEGIN { plan tests => 8 };
+BEGIN { plan tests => 10 };
use PurpleWiki::UserDB::UseMod;
use PurpleWiki::Config;
@@ -23,6 +23,7 @@ my $userDb = PurpleWiki::UserDB::UseMod->new;
my $user = $userDb->createUser;
ok($user->id == 1001);
$user->username($userName);
+$user->setPassword('yoyoyo');
$userDb->saveUser($user);
ok(-f "$datadir/user/1/1001.db");
@@ -36,6 +37,11 @@ $user = undef;
$user = $userDb->loadUser($userDb->idFromUsername($userName));
ok($user->id == 1001);
ok($user->username eq $userName);
+ok($user->getPassword eq 'yoyoyo');
+
+# undef password
+$user->setPassword(undef);
+ok(!defined $user->getPassword);
# rename the user
$user->username('eekim');

0 comments on commit 3decba9

Please sign in to comment.