kareila: (Default)
kareila ([personal profile] kareila) wrote in [site community profile] changelog2009-11-12 06:17 pm

[dw-free] fix t/console-suspend.t

[commit: http://hg.dwscoalition.org/dw-free/rev/2a240f4f8cb7]

http://bugs.dwscoalition.org/show_bug.cgi?id=2081

Fix console-suspend test so it works again.

Patch by [personal profile] yvi.

Files modified:
  • cgi-bin/LJ/S2.pm
  • t/console-suspend.t
--------------------------------------------------------------------------------
diff -r 9ff9ffaf097a -r 2a240f4f8cb7 cgi-bin/LJ/S2.pm
--- a/cgi-bin/LJ/S2.pm	Thu Nov 12 11:18:05 2009 -0600
+++ b/cgi-bin/LJ/S2.pm	Thu Nov 12 12:17:12 2009 -0600
@@ -1897,9 +1897,8 @@ sub Entry_from_entryobj
     my $posterid = $entry_obj->posterid;
     my $userlite_journal = UserLite ( $journal );
     my $poster = $journal;
+    # except for communities, posterid and journalid should match, only load separate UserLite object if that is not the case
     my $userlite_poster = $userlite_journal;
-    # except for communities, posterid and journalid should match, only load separate UserLite object if that is not the case
-    my $userlite_journal = $userlite_poster;
     unless ( $posterid == $journalid ) {
         $poster = LJ::load_userid( $posterid );
         $userlite_poster = UserLite( $poster );
diff -r 9ff9ffaf097a -r 2a240f4f8cb7 t/console-suspend.t
--- a/t/console-suspend.t	Thu Nov 12 11:18:05 2009 -0600
+++ b/t/console-suspend.t	Thu Nov 12 12:17:12 2009 -0600
@@ -7,8 +7,7 @@ use LJ::Test qw (temp_user);
 use LJ::Test qw (temp_user);
 local $LJ::T_NO_COMMAND_PRINT = 1;
 
-#plan tests => 12;
-plan skip_all => 'Fix this test';
+plan tests => 12;
 
 my $u = temp_user();
 my $u2 = temp_user();
@@ -28,7 +27,7 @@ is($run->("suspend " . $u2->user . " 'be
 $u->grant_priv("suspend");
 
 is($run->("suspend " . $u2->user . " \"because\""),
-   "info: User '" . $u2->user . "' suspended.");
+   "success: User '" . $u2->user . "' suspended.");
 $u2 = LJ::load_user($u2->user);
 ok($u2->is_suspended, "User indeed suspended.");
 
@@ -42,12 +41,12 @@ is($run->("suspend " . $u2->email_raw . 
    . "error: " . $u2->user . " is already suspended.");
 
 is($run->("unsuspend " . $u2->user . " \"because\""),
-   "info: User '" . $u2->user . "' unsuspended.");
+   "success: User '" . $u2->user . "' unsuspended.");
 $u2 = LJ::load_user($u2->user);
 ok(!$u2->is_suspended, "User is no longer suspended.");
 
 is($run->("suspend " . $u2->user . " \"because\""),
-   "info: User '" . $u2->user . "' suspended.");
+   "success: User '" . $u2->user . "' suspended.");
 $u2 = LJ::load_user($u2->user);
 ok($u2->is_suspended, "User suspended again.");
 
@@ -58,7 +57,7 @@ is($run->("unsuspend " . $u2->email_raw 
    . "info:    unsuspend " . $u2->email_raw . " \"because\" confirm");
 is($run->("unsuspend " . $u2->email_raw . " \"because\" confirm"),
    "info: Acting on users matching email " . $u2->email_raw . "\n"
-   . "info: User '" . $u2->user . "' unsuspended.");
+   . "success: User '" . $u2->user . "' unsuspended.");
 ok(!$u2->is_suspended, "User is no longer suspended.");
 
 
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org