More cleanup from dispatch. Do not set the session asset if the requested URL does not exist. In RssFeed, pass the fragment to the next method. Fixes bug #11854.
This commit is contained in:
parent
ef6e78fc27
commit
e99ae4740f
5 changed files with 30 additions and 6 deletions
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
use strict;
|
||||
use Test::More;
|
||||
use Test::MockObject::Extends;
|
||||
use Test::Deep;
|
||||
use Data::Dumper;
|
||||
use WebGUI::Test; # Must use this before any other WebGUI modules
|
||||
|
|
@ -87,11 +88,6 @@ my $utf8
|
|||
|
||||
WebGUI::Test->addToCleanup( WebGUI::VersionTag->getWorking( $session ) );
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Tests
|
||||
|
||||
plan tests => 25; # Increment this number for each test you create
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# test getUrlPermutation( url ) method
|
||||
|
||||
|
|
@ -230,4 +226,18 @@ my $output = WebGUI::Content::Asset::handler( $notModifiedSession );
|
|||
isnt( $notModifiedSession->http->getStatus, "304", "logged in user doesn't get 304" );
|
||||
ok( !$notModifiedSession->closed, "session is not closed" );
|
||||
|
||||
# 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');
|
||||
$nonexistant_url = join '/', $nonexistant_url, 'nothing_here_to_see';
|
||||
$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';
|
||||
|
||||
done_testing;
|
||||
|
||||
#vim:ft=perl
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue