Commit | Line | Data |
3bb728fd |
1 | #!/usr/bin/env perl |
2 | use strict; |
3 | use warnings; |
4 | |
5 | use FindBin; |
6 | use lib "$FindBin::Bin/../lib"; |
7 | |
8 | use Test::More; |
9 | use Catalyst::Test 'MyApp::Web'; |
10 | |
11 | like get('/'), qr/welcome/i, 'root page displays welcome'; |
12 | is get('/ifthisisfoundsomeonehasserioustestnamingissues'), 'Page Not Found', 'default captures 404'; |
13 | |
14 | is get('/calc/add/3/4/5'), 12, 'addition'; |
15 | is get('/calc/multiply/2/3/4'), 24, 'multiplication'; |
16 | |
17 | is get('/calc/unknownthingy/3/4/5'), 'unknown operator', 'unknown operator'; |
67f39940 |
18 | is get('/calc/add/3/f/5'), 'Not found', 'bad request'; |
3bb728fd |
19 | |
20 | like get('/foo/hello'), qr/root controller role/, 'root controller role'; |
21 | |
22 | is get('/foo/2/3/add'), 5, 'add two'; |
23 | is get('/foo/2/3/multiply'), 6, 'multiply two'; |
24 | |
67f39940 |
25 | is get('/foo/2/f/add'), 'Not found', 'bad request capture args'; |
3bb728fd |
26 | |
27 | done_testing; |