Check for fragment existance. Clarify a test.

This commit is contained in:
Colin Kuskie 2010-07-29 09:24:56 -07:00
parent a649816db8
commit 7e96b15141
2 changed files with 2 additions and 1 deletions

View file

@ -574,6 +574,7 @@ A URL.
sub dispatch {
my ($self, $fragment) = @_;
if (my $func = $self->session->form->param('func')) {
return undef if $fragment && $fragment ne $self->getUrl;
if (my $sub = $self->can('www_'.$func)) {
return $sub->();
}

View file

@ -86,7 +86,7 @@ ok( $output, "dispatch returned something, maybe not found page?" );
isnt( $output, "www_edit", "?func= dispatch cancelled because of unhandled fragment" );
$session->request->setup_body( { } );
$output = $td->dispatch( '/bar' );
$output = $td->dispatch( '/not-foo' );
ok( $output, "dispatch returned something, maybe not found page?" );
isnt( $output, "www_view", "?func= dispatch cancelled because of unhandled fragment" );