1#!/usr/bin/env perl
2use warnings;
3use strict;
4
5use Jifty::Test::Dist tests => 29;
6use Jifty::Test::WWW::Mechanize;
7
8my $server  = Jifty::Test->make_server;
9
10isa_ok($server, 'Jifty::TestServer');
11
12my $URL     = $server->started_ok;
13my $mech    = Jifty::Test::WWW::Mechanize->new();
14
15$mech->get_ok("$URL/dispatch/basic", "Got /dispatch/basic");
16$mech->content_contains("Basic test.");
17$mech->content_contains("count: 0");
18$mech->content_contains("before: 0");
19$mech->content_contains("after: 0");
20$mech->content_contains("after_once: 0");
21$mech->content_lacks("phantom: 99");
22
23$mech->get_ok("$URL/dispatch/basic-show", "Got /dispatch/basic-show");
24$mech->content_contains("Basic test with forced show.");
25$mech->content_contains("count: 1");
26$mech->content_contains("before: 1");
27$mech->content_contains("after: 1");
28$mech->content_contains("after_once: 1");
29
30$mech->get_ok("$URL/dispatch/show/", "Got /dispatch/show");
31$mech->content_contains("Basic test with forced show.");
32$mech->content_contains("count: 2");
33$mech->content_lacks("count: 3");
34$mech->content_contains("before: 3");
35$mech->content_contains("after: 2");
36$mech->content_contains("after_once: 2");
37
38$mech->get_ok("$URL/dispatch/", "Got /dispatch/");
39$mech->content_contains("Basic test.");
40$mech->content_contains("count: 3");
41$mech->content_lacks("count: 4");
42$mech->content_contains("before: 4");
43$mech->content_contains("after: 4");
44$mech->content_contains("after_once: 3");
45
46
47
48