4 use Test::More qw/no_plan/;
6 use HTTP::Request::Common;
11 my $cookie_jar = HTTP::Cookies->new;
12 my $agent = WWW::Mechanize->new();
14 # give the agent a place to stash the cookies
16 $agent->cookie_jar($cookie_jar);
22 my $url = $RT::WebURL;
25 is ($agent->{'status'}, 200, "Loaded a page");
30 # follow the link marked "Login"
32 ok($agent->{form}->find_input('user'));
34 ok($agent->{form}->find_input('pass'));
35 ok ($agent->{'content'} =~ /username:/i);
36 $agent->field( 'user' => 'root' );
37 $agent->field( 'pass' => 'password' );
38 # the field isn't named, so we have to click link 0
40 is($agent->{'status'}, 200, "Fetched the page ok");
41 ok( $agent->{'content'} =~ /Logout/i, "Found a logout link");
45 find ( \&wanted , 'html/');
48 -f && /\.html$/ && $_ !~ /Logout.html$/ && test_get($File::Find::name);
56 ok ($agent->get("$url/$file", "GET $url/$file"));
57 is ($agent->{'status'}, 200, "Loaded $file");
58 # ok( $agent->{'content'} =~ /Logout/i, "Found a logout link on $file ");
59 ok( $agent->{'content'} !~ /Not logged in/i, "Still logged in for $file");
60 ok( $agent->{'content'} !~ /System error/i, "Didn't get a Mason compilation error on $file");