[dw-free] fix the rest of the console-* tests
[commit: http://hg.dwscoalition.org/dw-free/rev/5b73af4fd615]
http://bugs.dwscoalition.org/show_bug.cgi?id=2487
Fix assorted tests for console commands.
Patch by
kareila.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=2487
Fix assorted tests for console commands.
Patch by
Files modified:
- t/console-finduser.t
- t/console-friend.t
- t/console-getrelation.t
- t/console-moodthemes.t
--------------------------------------------------------------------------------
diff -r 18fd86911d06 -r 5b73af4fd615 t/console-finduser.t
--- a/t/console-finduser.t Mon Apr 05 08:29:12 2010 -0700
+++ b/t/console-finduser.t Mon Apr 05 08:38:21 2010 -0700
@@ -7,7 +7,7 @@ use LJ::Test qw (temp_user);
use LJ::Test qw (temp_user);
local $LJ::T_NO_COMMAND_PRINT = 1;
-plan skip_all => 'Fix this test!';
+plan tests => 8;
my $u = temp_user();
LJ::set_remote($u);
diff -r 18fd86911d06 -r 5b73af4fd615 t/console-friend.t
--- a/t/console-friend.t Mon Apr 05 08:29:12 2010 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-# -*-perl-*-
-use strict;
-use Test::More;
-use lib "$ENV{LJHOME}/cgi-bin";
-require 'ljlib.pl';
-use LJ::Console;
-use LJ::Test qw (temp_user temp_comm);
-local $LJ::T_NO_COMMAND_PRINT = 1;
-
-plan skip_all => 'Fix this test!';
-
-my $u = temp_user();
-my $u2 = temp_user();
-LJ::set_remote($u);
-
-my $run = sub {
- my $cmd = shift;
- return LJ::Console->run_commands_text($cmd);
-};
-
-$u->add_friend($u2); # known starting point
-$u->remove_friend($u);
-
-is($run->("friend remove " . $u2->user),
- "success: " . $u2->user . " removed from friends list.");
-ok(!$u->is_friend($u2), "Removed from Friends list");
-
-is($run->("friend add " . $u2->user),
- "success: " . $u2->user . " added as a friend.");
-ok($u->is_friend($u2), "Removed from Friends list");
-
-is($run->("friend add " . $u2->user . " fakefriendgroup"),
- "error: You don't have a group called 'fakefriendgroup'.\n" .
- "success: " . $u2->user . " added as a friend.");
-
-is($run->("friend list"),
- "info: User S T Name\n" .
- "info: ----------------------------------------------------------\n" .
- "info: " . sprintf("%-15s %1s %1s %s", $u2->user, "", "", $u2->name_raw));
-
-
diff -r 18fd86911d06 -r 5b73af4fd615 t/console-getrelation.t
--- a/t/console-getrelation.t Mon Apr 05 08:29:12 2010 -0700
+++ b/t/console-getrelation.t Mon Apr 05 08:38:21 2010 -0700
@@ -7,7 +7,7 @@ use LJ::Test qw (temp_user temp_comm);
use LJ::Test qw (temp_user temp_comm);
local $LJ::T_NO_COMMAND_PRINT = 1;
-plan skip_all => 'Fix this test!';
+plan tests => 5;
my $u = temp_user();
my $comm = temp_comm();
diff -r 18fd86911d06 -r 5b73af4fd615 t/console-moodthemes.t
--- a/t/console-moodthemes.t Mon Apr 05 08:29:12 2010 -0700
+++ b/t/console-moodthemes.t Mon Apr 05 08:38:21 2010 -0700
@@ -7,8 +7,7 @@ use LJ::Test qw (temp_user temp_comm);
use LJ::Test qw (temp_user temp_comm);
local $LJ::T_NO_COMMAND_PRINT = 1;
-#plan tests => 23;
-plan skip_all => 'Fix this test!';
+plan tests => 23;
my $u = temp_user();
@@ -20,8 +19,8 @@ my $run = sub {
### CREATING AND LISTING THEMES #######
# FIXME: be less ghetto about this.
-ok($run->("moodtheme_list") =~ "acedia's Little Gent", "Got public theme");
-ok($run->("moodtheme_list 1") =~ "32x48 /img/mood/acedia/littlegent/cranky.gif", "Got a theme");
+ok($run->("moodtheme_list") =~ "Kanji Moods", "Got public theme");
+ok($run->("moodtheme_list 1") =~ "18x18 /img/mood/kanji/crazy.gif", "Got a theme");
ok($run->("moodtheme_list") !~ "Your themes", "No logged-in stuff.");
LJ::set_remote($u);
--------------------------------------------------------------------------------
