Coverage tests for getBackToSiteURL brings Session/Url coverage
up to 100%.
This commit is contained in:
parent
1cf78f5321
commit
dac78e161c
1 changed files with 26 additions and 1 deletions
|
|
@ -51,7 +51,7 @@ my @getRefererUrlTests = (
|
||||||
);
|
);
|
||||||
|
|
||||||
use Test::More;
|
use Test::More;
|
||||||
plan tests => 51 + scalar(@getRefererUrlTests);
|
plan tests => 54 + scalar(@getRefererUrlTests);
|
||||||
|
|
||||||
my $session = WebGUI::Test->session;
|
my $session = WebGUI::Test->session;
|
||||||
|
|
||||||
|
|
@ -350,6 +350,31 @@ is(
|
||||||
q!getBackToSiteURL: Root returns you to the default Asset!
|
q!getBackToSiteURL: Root returns you to the default Asset!
|
||||||
);
|
);
|
||||||
|
|
||||||
|
my $statefulAsset = WebGUI::Asset->getRoot($session)->addChild({ className => 'WebGUI::Asset::Snippet' });
|
||||||
|
|
||||||
|
$statefulAsset->{_properties}{state} = 'archived';
|
||||||
|
$session->asset( $statefulAsset );
|
||||||
|
is(
|
||||||
|
$session->url->getBackToSiteURL,
|
||||||
|
WebGUI::Asset->getRoot($session)->getUrl,
|
||||||
|
q!getBackToSiteURL: When asset state is archived, it returns you to the Asset's container!
|
||||||
|
);
|
||||||
|
|
||||||
|
$statefulAsset->{_properties}{state} = 'published';
|
||||||
|
is(
|
||||||
|
$session->url->getBackToSiteURL,
|
||||||
|
WebGUI::Asset->getRoot($session)->getUrl,
|
||||||
|
q!getBackToSiteURL: When asset state is published, it returns you to the Asset's container!
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
$statefulAsset->{_properties}{state} = 'trash';
|
||||||
|
is(
|
||||||
|
$session->url->getBackToSiteURL,
|
||||||
|
$defaultAssetUrl,
|
||||||
|
q!getBackToSiteURL: When asset state is not archived or published, it returns you to the default Asset!
|
||||||
|
);
|
||||||
|
|
||||||
END { ##Always clean-up
|
END { ##Always clean-up
|
||||||
$session->asset($sessionAsset);
|
$session->asset($sessionAsset);
|
||||||
$versionTag->rollback;
|
$versionTag->rollback;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue