Skip to content

Commit

Permalink
do not test undefined behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 14, 2014
1 parent a428464 commit b946ff6
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions t/mojolicious/routes.t
Expand Up @@ -138,15 +138,6 @@ $r->route('/method/post_get')->via(qw(POST get))
# /simple/form
$r->route('/simple/form')->to('test-test#test');

# /edge/auth/gift
# /edge/auth/about
# /edge/auth/album/create
my $edge = $r->route('/edge');
my $auth = $edge->bridge('/auth')->to('auth#check');
$auth->route('/about/')->to('pref#about');
$auth->bridge->to('album#allow')->route('/album/create/')->to('album#create');
$auth->route('/gift/')->to('gift#index')->name('gift');

# /regex/alternatives/*
$r->route('/regex/alternatives/:alternatives', alternatives => qr/foo|bar|baz/)
->to(controller => 'regex', action => 'alternatives');
Expand Down Expand Up @@ -668,35 +659,6 @@ is_deeply $m->stack, [{controller => 'test-test', action => 'test'}],
is $m->path_for, '/simple/form', 'right path';
is $m->path_for('current'), '/simple/form', 'right path';

# Special edge case with nested bridges
$m = Mojolicious::Routes::Match->new(root => $r);
$m->match($c => {method => 'GET', path => '/edge/auth/gift'});
@stack = (
{controller => 'auth', action => 'check'},
{controller => 'gift', action => 'index'}
);
is_deeply $m->stack, \@stack, 'right structure';
is $m->path_for, '/edge/auth/gift', 'right path';
is $m->path_for('gift'), '/edge/auth/gift', 'right path';
is $m->path_for('current'), '/edge/auth/gift', 'right path';
$m = Mojolicious::Routes::Match->new(root => $r);
$m->match($c => {method => 'GET', path => '/edge/auth/about'});
@stack = (
{controller => 'auth', action => 'check'},
{controller => 'pref', action => 'about'}
);
is_deeply $m->stack, \@stack, 'right structure';
is $m->path_for, '/edge/auth/about', 'right path';
$m = Mojolicious::Routes::Match->new(root => $r);
$m->match($c => {method => 'GET', path => '/edge/auth/album/create'});
@stack = (
{controller => 'auth', action => 'check'},
{controller => 'album', action => 'allow'},
{controller => 'album', action => 'create'}
);
is_deeply $m->stack, \@stack, 'right structure';
is $m->path_for, '/edge/auth/album/create', 'right path';

# Special edge case with nested bridges (regex)
$m = Mojolicious::Routes::Match->new(root => $r);
$m->match($c => {method => 'GET', path => '/regex/alternatives/foo'});
Expand Down

0 comments on commit b946ff6

Please sign in to comment.