File: redirect.t

package info (click to toggle)
libmojolicious-plugin-cgi-perl 0.12-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 188 kB
  • ctags: 13
  • sloc: perl: 211; makefile: 4
file content (20 lines) | stat: -rw-r--r-- 391 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use warnings;
use strict;
use Test::More;
use Test::Mojo;

plan skip_all => 't/cgi-bin/redirect.pl' unless -x 't/cgi-bin/redirect.pl';

{
  use Mojolicious::Lite;
  plugin CGI => [ '/redirect' => 't/cgi-bin/redirect.pl' ];
}

my $t = Test::Mojo->new;

$t->get_ok('/redirect', {} )
  ->status_is(302)
  ->header_is('Location' => 'http://somewhereelse.com')
  ->content_is('');

done_testing;