add "asset" property to AssetHelpers.
Simplifies the API and allows us to have getForm and getUrl to make asset helpers easier to build.
This commit is contained in:
parent
df31c13e13
commit
698f40a6dd
23 changed files with 216 additions and 123 deletions
|
|
@ -31,11 +31,11 @@ my $session = WebGUI::Test->session;
|
|||
# Tests
|
||||
|
||||
my $output;
|
||||
my $helper = WebGUI::AssetHelper::Delete->new( id => 'Delete', session => $session );
|
||||
my $import = WebGUI::Asset->getImportNode($session);
|
||||
my $helper = WebGUI::AssetHelper::Delete->new( id => 'Delete', session => $session, asset => $import );
|
||||
|
||||
$session->user({userId => 1});
|
||||
$output = $helper->process($import);
|
||||
$output = $helper->process;
|
||||
cmp_deeply(
|
||||
$output,
|
||||
{
|
||||
|
|
@ -45,7 +45,7 @@ cmp_deeply(
|
|||
);
|
||||
|
||||
$session->user({userId => 3});
|
||||
$output = $helper->process($import);
|
||||
$output = $helper->process;
|
||||
cmp_deeply(
|
||||
$output,
|
||||
{
|
||||
|
|
@ -55,7 +55,8 @@ cmp_deeply(
|
|||
);
|
||||
|
||||
my $safe_page = $import->getFirstChild;
|
||||
$output = $helper->process($safe_page);
|
||||
my $helper = WebGUI::AssetHelper::Delete->new( id => 'Delete', session => $session, asset => $safe_page );
|
||||
$output = $helper->process;
|
||||
cmp_deeply(
|
||||
$output,
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue