rework tests to handle new asset behavior
This commit is contained in:
parent
7291e2b6f0
commit
fbec25f5f7
2 changed files with 7 additions and 5 deletions
|
|
@ -21,7 +21,7 @@ use Image::Magick;
|
||||||
|
|
||||||
use Test::More; # increment this value for each test you create
|
use Test::More; # increment this value for each test you create
|
||||||
use Test::Deep;
|
use Test::Deep;
|
||||||
plan tests => 7;
|
plan tests => 8;
|
||||||
|
|
||||||
my $session = WebGUI::Test->session;
|
my $session = WebGUI::Test->session;
|
||||||
|
|
||||||
|
|
@ -52,8 +52,9 @@ my $properties = {
|
||||||
my $defaultAsset = WebGUI::Asset->getDefault($session);
|
my $defaultAsset = WebGUI::Asset->getDefault($session);
|
||||||
my $asset = $defaultAsset->addChild($properties, $properties->{id});
|
my $asset = $defaultAsset->addChild($properties, $properties->{id});
|
||||||
|
|
||||||
ok($asset->get('storageId'), 'File Asset created with initial storage location');
|
is($asset->get('storageId'), '', 'File Asset created with no initial storage location');
|
||||||
ok($asset->getStorageLocation, 'File Asset getStorageLocation initialized');
|
ok($asset->getStorageLocation, 'File Asset getStorageLocation initialized');
|
||||||
|
ok($asset->get('storageId'), 'getStorageLocation updates asset object with storage location');
|
||||||
is($asset->get('storageId'), $asset->getStorageLocation->getId, 'Asset storageId and cached storageId agree');
|
is($asset->get('storageId'), $asset->getStorageLocation->getId, 'Asset storageId and cached storageId agree');
|
||||||
|
|
||||||
$asset->update({
|
$asset->update({
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ use Image::Magick;
|
||||||
|
|
||||||
use Test::More; # increment this value for each test you create
|
use Test::More; # increment this value for each test you create
|
||||||
use Test::Deep;
|
use Test::Deep;
|
||||||
plan tests => 7;
|
plan tests => 8;
|
||||||
|
|
||||||
my $session = WebGUI::Test->session;
|
my $session = WebGUI::Test->session;
|
||||||
|
|
||||||
|
|
@ -55,9 +55,10 @@ my $properties = {
|
||||||
my $defaultAsset = WebGUI::Asset->getDefault($session);
|
my $defaultAsset = WebGUI::Asset->getDefault($session);
|
||||||
my $asset = $defaultAsset->addChild($properties, $properties->{id});
|
my $asset = $defaultAsset->addChild($properties, $properties->{id});
|
||||||
|
|
||||||
ok($asset->get('storageId'), 'Image Asset created with initial storage location');
|
is($asset->get('storageId'), '', 'Image Asset created with no initial storage location');
|
||||||
ok($asset->getStorageLocation, 'Image Asset getStorageLocation initialized');
|
ok($asset->getStorageLocation, 'Image Asset getStorageLocation initialized');
|
||||||
is($asset->get('storageId'), $asset->getStorageLocation->getId, 'Asset storageId and cached storageId agree');
|
ok($asset->get('storageId'), 'getStorageLocation updates Image asset object with storage location');
|
||||||
|
is($asset->get('storageId'), $asset->getStorageLocation->getId, 'Image Asset storageId and cached storageId agree');
|
||||||
|
|
||||||
$asset->update({
|
$asset->update({
|
||||||
storageId => $storage->getId,
|
storageId => $storage->getId,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue