From 7a3ec47f6d0f6f21884045339425160ac3063bee Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Sun, 12 Sep 2010 22:38:09 -0700 Subject: [PATCH] Test that the RSS Aspect propagates the URL fragment. --- t/Content/Asset.t | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/t/Content/Asset.t b/t/Content/Asset.t index 4c291e51d..beccd90e5 100644 --- a/t/Content/Asset.t +++ b/t/Content/Asset.t @@ -93,7 +93,7 @@ WebGUI::Test->addToCleanup( WebGUI::VersionTag->getWorking( $session ) ); #---------------------------------------------------------------------------- # Tests -plan tests => 22; # Increment this number for each test you create +plan tests => 23; # Increment this number for each test you create #---------------------------------------------------------------------------- # test getUrlPermutation( url ) method @@ -206,9 +206,6 @@ is $output, 'www_view one', 'an empty URL returns the default asset'; $session->setting->set('defaultPage', $originalDefaultPage); # Test that requesting a URL that doesn't exist, but one of the permutations does exist, returns undef -#my $default = WebGUI::Asset->getDefault($session); -#my $mockDefault = Test::MockObject::Extends->new($default); -#$mockDefault->mock('addMissing', sub { return "add missing" }); $session->request->setup_body({ }); my $nonexistant_url = WebGUI::Asset->getDefault($session)->get('url'); @@ -217,4 +214,16 @@ $output = WebGUI::Content::Asset::dispatch( $session, $nonexistant_url ); 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({ + 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'; + #vim:ft=perl