'GET request for /foo went to the right sub'
);
- request( GET '/foo', ( Accept => '*/*', ) );
+ request( GET '/foo', ( Accept => '*/*' ) );
is(
$MyApp1::Controller::C1::REQ{get_html}, 1,
}
{
- get('/chain1/42/chain2/84/baz/foo');
+ request( GET '/chain1/42/chain2/84/baz/foo' );
is(
$MyApp1::Controller::C1::REQ{chain1}, 42,
}
{
- get('/user/99');
+ request( GET '/user/99' );
is(
$MyApp1::Controller::C1::REQ{user}, 99,
);
is(
- $MyApp1::Controller::C1::REQ{empty}, 99,
+ $MyApp1::Controller::C1::REQ{user_end}, 99,
'get /user/99 calls get chained from _set_user'
);
}
{
- get('/normal');
+ request( GET '/thing/99' );
+
+ is(
+ $MyApp1::Controller::C1::REQ{thing}, 99,
+ 'get /thing/99 calls _set_thing chain point'
+ );
+
+ is(
+ $MyApp1::Controller::C1::REQ{thing_end}, 99,
+ 'get /thing/99 calls get chained from _set_thing'
+ );
+}
+
+{
+ request( GET '/normal' );
is(
$MyApp1::Controller::C1::REQ{normal}, 1,
);
}
+{
+ request( GET '/' );
+
+ is(
+ $MyApp1::Controller::Root::REQ{root}, 1,
+ 'GET request for / went to the right sub (routes work when namespace is empty string)'
+ );
+
+ request( GET '/foo.txt' );
+
+ is(
+ $MyApp1::Controller::Root::REQ{'foo.txt'}, 1,
+ 'GET request for /foo.txt went to the right sub (routes work when namespace is empty string)'
+ );
+}
+
done_testing();