Akron | dd5ab89 | 2021-09-08 12:46:08 +0200 | [diff] [blame] | 1 | use Mojo::Base -strict; |
| 2 | use Test::More; |
| 3 | use Test::Mojo; |
| 4 | |
| 5 | # Test legacy links for documentation |
| 6 | |
| 7 | my $t = Test::Mojo->new('Kalamar'); |
| 8 | |
| 9 | my $h = $t->get_ok('/doc/korap') |
| 10 | ->status_is(302) |
| 11 | ->header_like('Location',qr!/doc/+development!) |
| 12 | ->tx->res->headers->header('Location') |
| 13 | ; |
| 14 | |
| 15 | $t->get_ok($h) |
| 16 | ->status_is(200) |
| 17 | ; |
| 18 | |
| 19 | $h = $t->get_ok('/doc/korap/kalamar') |
| 20 | ->status_is(302) |
| 21 | ->header_like('Location',qr!/doc/+development/+kalamar!) |
| 22 | ->tx->res->headers->header('Location') |
| 23 | ; |
| 24 | |
| 25 | $t->get_ok($h) |
| 26 | ->status_is(200) |
| 27 | ; |
| 28 | |
| 29 | $t->get_ok('/doc/korap/karang') |
| 30 | ->status_is(302) |
| 31 | ->header_like('Location',qr!/doc/+development/+karang!) |
| 32 | ; |
| 33 | |
| 34 | $t->get_ok('/doc/korap/koral') |
| 35 | ->status_is(302) |
| 36 | ->header_like('Location',qr!/doc/+development/+koral!) |
| 37 | ; |
| 38 | |
| 39 | $t->get_ok('/doc/korap/krill') |
| 40 | ->status_is(302) |
| 41 | ->header_like('Location',qr!/doc/+development/+krill!) |
| 42 | ; |
| 43 | |
| 44 | $t->get_ok('/doc/korap/kustvakt') |
| 45 | ->status_is(302) |
| 46 | ->header_like('Location',qr!/doc/+development/+kustvakt!) |
| 47 | ; |
| 48 | |
| 49 | done_testing(); |