diff --git a/t/Asset/Post.t b/t/Asset/Post.t index 2bd416d34..4846fbb52 100644 --- a/t/Asset/Post.t +++ b/t/Asset/Post.t @@ -43,10 +43,11 @@ my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"Collab setup"}); # Need to create a Collaboration system in which the post lives. -my $collab = $node->addChild({className => 'WebGUI::Asset::Wobject::Collaboration', editTimeout => '1'}); +my @addArgs = ( undef, undef, { skipAutoCommitWorkflows => 1, skipNotification => 1 } ); + +my $collab = $node->addChild({className => 'WebGUI::Asset::Wobject::Collaboration', editTimeout => '1'}, @addArgs); # The Collaboration system must be committed before a post can be made. -$versionTag->commit(); # Need to do $post->canEdit tests, which test group membership. Therefore, # create three users and a group for the process. One user will be doing the @@ -63,6 +64,7 @@ my $groupIdEditGroup = WebGUI::Group->new($session, $collab->get('groupIdEdit WebGUI::Test->usersToDelete($postingUser, $otherUser, $groupIdEditUser); $postingUser->username('userForPosting'); $otherUser->username('otherUser'); +WebGUI::Test->groupsToDelete($groupToEditPost, $groupIdEditGroup); # Add the posting user to the group allowd to post. $postingUser->addToGroups([$collab->get('postGroupId')]); @@ -86,7 +88,10 @@ my $props = { content => 'hello, world!', }; -my $post = $collab->addChild($props); +my $post = $collab->addChild($props, @addArgs); + +$versionTag->commit(); +WebGUI::Test->tagsToRollback($versionTag); # Test for a sane object type isa_ok($post, 'WebGUI::Asset::Post::Thread'); @@ -116,8 +121,6 @@ TODO: { } END { - # Clean up after thyself - $versionTag->rollback(); } diff --git a/t/Asset/Post/permission.t b/t/Asset/Post/permission.t index 6074d9275..1f9611e11 100644 --- a/t/Asset/Post/permission.t +++ b/t/Asset/Post/permission.t @@ -72,25 +72,25 @@ $post = WebGUI::Asset->newByDynamicClass( $session, $post->getId ); #---------------------------------------------------------------------------- # Tests -plan tests => 0; +plan tests => 12; #---------------------------------------------------------------------------- # Permissions for posts # View -#$maker->prepare( { -# object => $post, -# method => 'canView', -# pass => [ '1', $user{"2"}, '3', ], -#} )->run; -# +$maker->prepare( { + object => $post, + method => 'canView', + pass => [ '1', $user{"2"}, '3', ], +} )->run; + ## Edit -#$maker->prepare( { -# object => $post, -# method => 'canEdit', -# pass => [ $user{"2"}, '3', ], -# fail => [ '1', ], -#} )->run; -# +$maker->prepare( { + object => $post, + method => 'canEdit', + pass => [ $user{"2"}, '3', ], + fail => [ '1', ], +} )->run; + #---------------------------------------------------------------------------- # Cleanup END {