Check for fragment existance. Clarify a test.
This commit is contained in:
parent
a649816db8
commit
7e96b15141
2 changed files with 2 additions and 1 deletions
|
|
@ -574,6 +574,7 @@ A URL.
|
||||||
sub dispatch {
|
sub dispatch {
|
||||||
my ($self, $fragment) = @_;
|
my ($self, $fragment) = @_;
|
||||||
if (my $func = $self->session->form->param('func')) {
|
if (my $func = $self->session->form->param('func')) {
|
||||||
|
return undef if $fragment && $fragment ne $self->getUrl;
|
||||||
if (my $sub = $self->can('www_'.$func)) {
|
if (my $sub = $self->can('www_'.$func)) {
|
||||||
return $sub->();
|
return $sub->();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ ok( $output, "dispatch returned something, maybe not found page?" );
|
||||||
isnt( $output, "www_edit", "?func= dispatch cancelled because of unhandled fragment" );
|
isnt( $output, "www_edit", "?func= dispatch cancelled because of unhandled fragment" );
|
||||||
|
|
||||||
$session->request->setup_body( { } );
|
$session->request->setup_body( { } );
|
||||||
$output = $td->dispatch( '/bar' );
|
$output = $td->dispatch( '/not-foo' );
|
||||||
ok( $output, "dispatch returned something, maybe not found page?" );
|
ok( $output, "dispatch returned something, maybe not found page?" );
|
||||||
isnt( $output, "www_view", "?func= dispatch cancelled because of unhandled fragment" );
|
isnt( $output, "www_view", "?func= dispatch cancelled because of unhandled fragment" );
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue