From fbec25f5f75197e291b20357c6bf86dfc3da821d Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 7 May 2007 04:32:04 +0000 Subject: [PATCH] rework tests to handle new asset behavior --- t/Asset/File.t | 5 +++-- t/Asset/File/Image.t | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/t/Asset/File.t b/t/Asset/File.t index 566457790..f54939777 100644 --- a/t/Asset/File.t +++ b/t/Asset/File.t @@ -21,7 +21,7 @@ use Image::Magick; use Test::More; # increment this value for each test you create use Test::Deep; -plan tests => 7; +plan tests => 8; my $session = WebGUI::Test->session; @@ -52,8 +52,9 @@ my $properties = { my $defaultAsset = WebGUI::Asset->getDefault($session); 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->get('storageId'), 'getStorageLocation updates asset object with storage location'); is($asset->get('storageId'), $asset->getStorageLocation->getId, 'Asset storageId and cached storageId agree'); $asset->update({ diff --git a/t/Asset/File/Image.t b/t/Asset/File/Image.t index 2415ce0b6..21d22d6f4 100644 --- a/t/Asset/File/Image.t +++ b/t/Asset/File/Image.t @@ -22,7 +22,7 @@ use Image::Magick; use Test::More; # increment this value for each test you create use Test::Deep; -plan tests => 7; +plan tests => 8; my $session = WebGUI::Test->session; @@ -55,9 +55,10 @@ my $properties = { my $defaultAsset = WebGUI::Asset->getDefault($session); 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'); -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({ storageId => $storage->getId,