Skip to content

Commit

Permalink
more url_for examples and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed May 14, 2013
1 parent e8ece6e commit a8d9124
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/Mojolicious/Controller.pm
Expand Up @@ -890,7 +890,9 @@ Get L<Mojo::UserAgent> object from L<Mojo/"ua">.
my $url = $c->url_for;
my $url = $c->url_for(name => 'sebastian');
my $url = $c->url_for({name => 'sebastian'});
my $url = $c->url_for('test', name => 'sebastian');
my $url = $c->url_for('test', {name => 'sebastian'});
my $url = $c->url_for('/perldoc');
my $url = $c->url_for('http://mojolicio.us/perldoc');
Expand Down
4 changes: 2 additions & 2 deletions t/mojolicious/lite_app.t
Expand Up @@ -297,7 +297,7 @@ post '/bar/:test' => {test => 'default'} => sub {

patch '/firefox/:stuff' => (agent => qr/Firefox/) => sub {
my $self = shift;
$self->render(text => $self->url_for('foxy', stuff => 'foo'));
$self->render(text => $self->url_for('foxy', {stuff => 'foo'}));
} => 'foxy';

get '/url_for_foxy' => sub {
Expand Down Expand Up @@ -426,7 +426,7 @@ get '/url_with';

get '/url_with/:foo' => sub {
my $self = shift;
$self->render(text => $self->url_with(foo => 'bar')->to_abs);
$self->render(text => $self->url_with({foo => 'bar'})->to_abs);
};

my $dynamic_inline = 1;
Expand Down

0 comments on commit a8d9124

Please sign in to comment.