Add a method that returns either the standard style template or the mobile style template based on the Session.
This commit is contained in:
parent
aabb4648d6
commit
4ac894d981
2 changed files with 31 additions and 4 deletions
|
|
@ -21,4 +21,20 @@ sub list_of_tables {
|
|||
return [qw/assetData wobject/];
|
||||
}
|
||||
|
||||
sub t_15_getStyleTemplateId : Test(2) {
|
||||
note "getStyleTemplateId";
|
||||
my ( $test ) = @_;
|
||||
my $session = $test->session;
|
||||
$session->style->setMobileStyle(0);
|
||||
$session->setting->set('useMobileStyle', 1);
|
||||
my ( $tag, $asset, @parents ) = $test->getAnchoredAsset();
|
||||
$asset->styleTemplateId('Style');
|
||||
$asset->mobileStyleTemplateId('Mobile');
|
||||
is $asset->getStyleTemplateId, 'Style', 'returns Style since mobile was not requested';
|
||||
$session->style->setMobileStyle(1);
|
||||
is $asset->getStyleTemplateId, 'Mobile', 'returns Mobile since mobile was set';
|
||||
$session->style->setMobileStyle(0);
|
||||
$session->setting->set('useMobileStyle', 0);
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue