blob: 8cbe3bd5bc86d8e6bd706850541a67f964c6a298 [file] [log] [blame]
Akrondd5ab892021-09-08 12:46:08 +02001use Mojo::Base -strict;
2use Test::More;
3use Test::Mojo;
4
5# Test legacy links for documentation
6
7my $t = Test::Mojo->new('Kalamar');
8
9my $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
49done_testing();