fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2010-04-05 03:50 pm

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

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

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

Remove tests for shared journal functions (obsolete/shared journals removed
from code). Update check for membership to proper new function.

Patch by [personal profile] kareila.

Files modified:
  • t/console-community.t
--------------------------------------------------------------------------------
diff -r cefe6191f033 -r d248a47982ee t/console-community.t
--- a/t/console-community.t	Mon Apr 05 08:51:02 2010 -0700
+++ b/t/console-community.t	Mon Apr 05 08:54:52 2010 -0700
@@ -8,7 +8,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 => 6;
 
 my $u = temp_user();
 my $u2 = temp_user();
@@ -37,36 +37,10 @@ LJ::join_community($comm, $u2);
 LJ::join_community($comm, $u2);
 is($run->("community " . $comm->user . " remove " . $u2->user),
    "success: User " . $u2->user . " removed from " . $comm->user);
-ok(!LJ::is_friend($comm, $u2), "User removed from community.");
+ok( ! $u2->member_of( $comm ), "User removed from community." );
 
 # test case where user's removing themselves
 LJ::join_community($comm2, $u);
 is($run->("community " . $comm2->user . " remove " . $u->user),
    "success: User " . $u->user . " removed from " . $comm2->user);
-ok(!LJ::is_friend($comm2, $u), "User removed self from community.");
-
-
-
-### SHARED JOURNAL FUNCTIONS #####
-my $shared = temp_user();
-LJ::update_user($shared, { journaltype => 'S' });
-$shared = LJ::load_user($shared->user);
-
-is($run->("shared " . $shared->user . " remove " . $u2->user),
-   "error: You don't have access to manage this shared journal.");
-
-LJ::set_rel($shared, $u, 'A');
-$refresh->();
-
-is($run->("shared " . $shared->user . " remove " . $u2->user),
-   "success: User " . $u2->user . " can no longer post in " . $shared->user . ".");
-
-is($run->("shared " . $shared->user . " add " . $u->user),
-   "success: User " . $u->user . " has been given posting access to " . $shared->user . ".");
-
-is($run->("shared " . $shared->user . " add " . $u2->user),
-   "success: User " . $u2->user . " has been sent a confirmation email, and will be able to post in "
-   . $shared->user . " when they confirm this action.");
-
-like($run->("shared " . $shared->user . " add " . $u2->user),
-     qr/already invited to join/);
+ok( ! $u->member_of( $comm2 ), "User removed self from community." );
--------------------------------------------------------------------------------

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