Fix some Gallery and GalleryAlbum tests.
This commit is contained in:
parent
dab177324d
commit
c56d2b9403
3 changed files with 10 additions and 30 deletions
|
|
@ -40,6 +40,8 @@ my $gallery
|
|||
});
|
||||
|
||||
$versionTag->commit;
|
||||
WebGUI::Test->addToCleanup($versionTag);
|
||||
$gallery->cloneFromDb;
|
||||
|
||||
is(
|
||||
Scalar::Util::blessed($gallery), "WebGUI::Asset::Wobject::Gallery",
|
||||
|
|
@ -61,14 +63,5 @@ isa_ok(
|
|||
my $properties = $gallery->get;
|
||||
$gallery->purge;
|
||||
|
||||
is(
|
||||
WebGUI::Asset->newById($session, $properties->{assetId}), undef,
|
||||
"Gallery no longer able to be instanciated",
|
||||
);
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Cleanup
|
||||
END {
|
||||
$versionTag->rollback();
|
||||
}
|
||||
eval { WebGUI::Asset->newById($session, $properties->{assetId}); };
|
||||
ok( Exception::Class->caught(), 'Gallery no longer able to be instanciated after purge');
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ my $album
|
|||
});
|
||||
|
||||
$versionTag->commit;
|
||||
WebGUI::Test->addToCleanup($versionTag);
|
||||
|
||||
is(
|
||||
Scalar::Util::blessed($album), "WebGUI::Asset::Wobject::GalleryAlbum",
|
||||
|
|
@ -66,14 +67,5 @@ isa_ok(
|
|||
my $properties = $album->get;
|
||||
$album->purge;
|
||||
|
||||
is(
|
||||
WebGUI::Asset->newById($session, $properties->{assetId}), undef,
|
||||
"Album no longer able to be instanciated",
|
||||
);
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Cleanup
|
||||
END {
|
||||
$versionTag->rollback();
|
||||
}
|
||||
eval { WebGUI::Asset->newById($session, $properties->{assetId}); };
|
||||
ok( Exception::Class->caught(), 'Album no longer able to be instanciated');
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ for (my $i = 0; $i < 5; $i++)
|
|||
|
||||
# Commit all changes
|
||||
$versionTag->commit;
|
||||
WebGUI::Test->addToCleanup($versionTag);
|
||||
|
||||
# Make album default asset
|
||||
$session->asset( $album );
|
||||
|
|
@ -95,7 +96,7 @@ use_ok("WebGUI::Asset::Wobject::GalleryAlbum");
|
|||
#----------------------------------------------------------------------------
|
||||
# Test calling without arguments
|
||||
|
||||
diag("general testing");
|
||||
note("general testing");
|
||||
|
||||
# Provide no arguments at all
|
||||
$result = callAjaxService({ });
|
||||
|
|
@ -105,7 +106,7 @@ ok( $result->{ err } != 0 && $result->{ errMessage }, "Error after call without
|
|||
#----------------------------------------------------------------------------
|
||||
# Test moveFile action with incomplete of invalid arguments
|
||||
|
||||
diag("moveFile action");
|
||||
note("moveFile action");
|
||||
|
||||
# Omit target
|
||||
$result = callAjaxService({
|
||||
|
|
@ -256,9 +257,3 @@ sub callAjaxService {
|
|||
# Call ajax service function and decode reply
|
||||
return decode_json( $album->www_ajax() );
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Cleanup
|
||||
END {
|
||||
$versionTag->rollback();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue