Fix duplicating storages in Posts and subscription groups in threads. Fixes bug #12024.

This commit is contained in:
Colin Kuskie 2011-01-24 19:08:51 -08:00
parent ebf7763d32
commit 052b3dfd45
5 changed files with 66 additions and 2 deletions

View file

@ -19,7 +19,7 @@ use strict;
use lib "$FindBin::Bin/../lib";
use WebGUI::Test;
use WebGUI::Session;
use Test::More tests => 18; # increment this value for each test you create
use Test::More tests => 20; # increment this value for each test you create
use Test::Deep;
use WebGUI::Asset::Wobject::Collaboration;
use WebGUI::Asset::Post;
@ -203,4 +203,16 @@ cmp_bag(
'checking attachment loop with multiple attachments for handling of image and non-image types'
);
######################################################################
#
# duplicate
#
######################################################################
{
my $post1_copy = $post1->duplicate;
ok $post1_copy->get('storageId'), 'copied post has a storage location';
isnt $post1->get('storageId'), $post1_copy->get('storageId'), '... and it is different from the source post';
}
# vim: syntax=perl filetype=perl

View file

@ -13,7 +13,7 @@ use strict;
use lib "$FindBin::Bin/../../lib";
use WebGUI::Test;
use WebGUI::Session;
use Test::More tests => 15; # increment this value for each test you create
use Test::More tests => 17; # increment this value for each test you create
use Test::MockObject::Extends;
use Test::Exception;
use WebGUI::Asset::Wobject::Collaboration;
@ -104,4 +104,14 @@ like $thread->getCSLinkUrl, qr/\?pn=5/, 'checking thread on another page, with a
$collab->update({threadsPerPage => 0, postsPerPage => 0,});
lives_ok { $uncommittedThread->getCSLinkUrl } '... works when pagination set to 0';
######################################################################
#
# duplicate
#
######################################################################
my $thread_copy = $thread->duplicate();
ok $thread_copy->get('subscriptionGroupId'), 'duplicate: copied thread got a subscription group';
isnt $thread_copy->get('subscriptionGroupId'), $thread->get('subscriptionGroupId'), '... and it is different from the original thread';
# vim: syntax=perl filetype=perl