Skip to content

Commit

Permalink
another routing test
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 14, 2015
1 parent f8e8e1d commit 3bec2b5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion t/mojolicious/routes.t
Expand Up @@ -213,7 +213,7 @@ $r->route('/partial')->detour('foo#bar');

# GET /similar/*
# PATCH /similar/too
my $similar = $r->route('/similar')->inline(1);
my $similar = $r->route('/similar')->via(qw(DELETE GET PATCH))->inline(1);
$similar->route('/:something')->via('GET')->to('similar#get');
$similar->route('/too')->via('PATCH')->to('similar#post');

Expand Down Expand Up @@ -941,5 +941,8 @@ $m->find($c => {method => 'PATCH', path => '/similar/too'});
is_deeply $m->stack, [{}, {controller => 'similar', action => 'post'}],
'right structure';
is $m->endpoint->suggested_method, 'PATCH', 'right method';
$m = Mojolicious::Routes::Match->new(root => $r);
$m->find($c => {method => 'DELETE', path => '/similar/too'});
is_deeply $m->stack, [], 'empty stack';

done_testing();

0 comments on commit 3bec2b5

Please sign in to comment.