Chop out crap that is not needed
[catagits/Catalyst-Plugin-Session.git] / t / session_valid.t
CommitLineData
3c2ec899 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 {
14 require Test::WWW::Mechanize::Catalyst;
15 Test::WWW::Mechanize::Catalyst->VERSION(0.51);
16 }
17 or plan skip_all =>
18 'Test::WWW::Mechanize::Catalyst >= 0.51 is required for this test';
19
20 plan tests => 4;
21}
d966a055 22use FindBin qw/$Bin/;
23use lib "$Bin/lib";
3c2ec899 24use Test::WWW::Mechanize::Catalyst "SessionValid";
25
26my $ua = Test::WWW::Mechanize::Catalyst->new;
27
28$ua->get_ok( "http://localhost/", "initial get" );
29$ua->content_contains( "value set", "page contains expected value" );
30
31sleep 2;
32
33$ua->get_ok( "http://localhost/", "grab the page again, after the session has expired" );
34$ua->content_contains( "value set", "page contains expected value" );
35