almost done fixing addRevision tests
This commit is contained in:
parent
6931fd471e
commit
7c14d1e6c4
122 changed files with 389 additions and 1052 deletions
|
|
@ -71,7 +71,7 @@ sub www_edit { return "you'll never see me!" }
|
|||
package main;
|
||||
|
||||
my $td
|
||||
= WebGUI::Asset->getImportNode( $session )->addChild( {
|
||||
= WebGUI::Test->asset->addChild( {
|
||||
title => "one",
|
||||
className => 'WebGUI::Asset::TestDispatch',
|
||||
url => 'testdispatch',
|
||||
|
|
@ -80,14 +80,12 @@ my $td
|
|||
my $utf8_url = "Viel-spa\x{00DF}";
|
||||
utf8::upgrade $utf8_url;
|
||||
my $utf8
|
||||
= WebGUI::Asset->getImportNode( $session )->addChild( {
|
||||
= WebGUI::Test->asset->addChild( {
|
||||
title => "utf8",
|
||||
className => 'WebGUI::Asset::TestDispatch',
|
||||
url => $utf8_url,
|
||||
} );
|
||||
|
||||
WebGUI::Test->addToCleanup( WebGUI::VersionTag->getWorking( $session ) );
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# test getUrlPermutation( url ) method
|
||||
|
||||
|
|
@ -159,12 +157,11 @@ is $output, "bar", "special /foo handler";
|
|||
|
||||
# Add an asset that clobbers the TestDispatch's /foo
|
||||
my $clobberingTime
|
||||
= WebGUI::Asset->getImportNode( $session )->addChild( {
|
||||
= WebGUI::Test->asset->addChild( {
|
||||
title => "two",
|
||||
className => 'WebGUI::Asset::TestDispatch',
|
||||
url => $td->get('url') . '/foo',
|
||||
} );
|
||||
WebGUI::Test->addToCleanup($clobberingTime);
|
||||
|
||||
is(
|
||||
WebGUI::Content::Asset::dispatch( $session, "testdispatch/foo" ),
|
||||
|
|
@ -177,7 +174,7 @@ $clobberingTime->purge;
|
|||
|
||||
# Add an asset that declines everything instead
|
||||
my $declined
|
||||
= WebGUI::Asset->getImportNode( $session )->addChild( {
|
||||
= WebGUI::Test->asset->addChild( {
|
||||
title => "three",
|
||||
className => 'WebGUI::Asset::TestDecline',
|
||||
url => $td->get('url') . '/foo',
|
||||
|
|
@ -209,14 +206,10 @@ $session->setting->set('defaultPage', $originalDefaultPage);
|
|||
#----------------------------------------------------------------------------
|
||||
# 304 Content Not Modified response
|
||||
|
||||
my $newAsset = WebGUI::Asset->getImportNode( $session )->addChild( {
|
||||
my $newAsset = WebGUI::Test->asset->addChild( {
|
||||
className => 'WebGUI::Asset::Wobject::Article',
|
||||
} );
|
||||
|
||||
my $tag = WebGUI::VersionTag->getWorking( $session );
|
||||
$tag->commit;
|
||||
WebGUI::Test->addToCleanup( $tag );
|
||||
|
||||
my $http_request = HTTP::Request::Common::GET('http://'.$session->config->get('sitename')->[0]);
|
||||
$http_request->header('If-Modified-Since' => $session->datetime->epochToHttp(time + 20)); # 20 seconds into the future!
|
||||
my $notModifiedSession = WebGUI::Test->newSession( undef, $http_request);
|
||||
|
|
@ -244,14 +237,13 @@ is $output, undef, 'getting a URL which does not exist returns undef';
|
|||
is $session->asset, undef, '... session asset is not set';
|
||||
|
||||
use WebGUI::Asset::RssAspectDummy;
|
||||
my $dummy = WebGUI::Asset->getImportNode($session)->addChild({
|
||||
my $dummy = WebGUI::Test->asset->addChild({
|
||||
className => 'WebGUI::Asset::RssAspectDummy',
|
||||
url => '/home/shawshank',
|
||||
title => 'Dummy Title',
|
||||
synopsis => 'Dummy Synopsis',
|
||||
description => 'Dummy Description',
|
||||
});
|
||||
WebGUI::Test->addToCleanup($dummy);
|
||||
$output = WebGUI::Content::Asset::dispatch( $session, '/home/shawshank/no-child-here' );
|
||||
is $output, undef, 'RSS Aspect propagates the fragment';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue