Checking in changes prior to tagging of version 0.23. Changelog diff is:
[catagits/Catalyst-Plugin-Session.git] / t / live_session_fixation.t
CommitLineData
73d1f3a2 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use Test::More;
7
8BEGIN {
9 eval { require Catalyst::Plugin::Session::State::Cookie; Catalyst::Plugin::Session::State::Cookie->VERSION(0.03) }
10 or plan skip_all =>
11 "Catalyst::Plugin::Session::State::Cookie 0.03 or higher is required for this test";
12
13 eval { require Test::WWW::Mechanize::Catalyst }
14 or plan skip_all =>
15 "Test::WWW::Mechanize::Catalyst is required for this test";
16
17 plan tests => 2;
18}
19
20use lib "t/lib";
21use Test::WWW::Mechanize::Catalyst "SessionTestApp";
22
23my $injected_cookie = "sessiontestapp_session=89c3a019866af6f5a305e10189fbb23df3f4772c";
24
25my $ua1 = Test::WWW::Mechanize::Catalyst->new;
26$ua1->add_header('Cookie' => $injected_cookie);
27
28my $res = $ua1->get( "http://localhost/login" );
29my $cookie = $res->header('Set-Cookie');
30
31ok $cookie;
32isnt $cookie, qr/$injected_cookie/, 'Logging in generates us a new cookie';
33