implement 'change_session_expires'
[catagits/Catalyst-Plugin-Session.git] / t / cat_test.t
CommitLineData
a2e23c04 1#!/usr/bin/env perl
2
3use strict;
4use warnings;
5use Test::More;
6use HTTP::Request::Common;
7
8# setup library path
9use FindBin qw($Bin);
10use lib "$Bin/lib";
11
12use Catalyst::Test 'SessionTestApp';
13my ($res, $c);
14
15($res, $c) = ctx_request(POST 'http://localhost/login', [username => 'bob', password => 's00p3r', remember => 1]);
16is($res->code, 200, 'succeeded');
17my $cookie = $res->header('Set-Cookie');
18ok($cookie, 'Have a cookie');
19
20# this checks that cookie persists across a redirect
601be17a 21($res, $c) = ctx_request(GET 'http://localhost/do_redirect', Cookie => $cookie);
22is($res->code, 302, 'redirected');
23is($res->header('Location'), 'http://localhost/page', 'Redirected after do_redirect');
24ok($res->header('Set-Cookie'), 'Cookie is still there after redirect');
a2e23c04 25
26done_testing;