--- t/koha/02-create-test-user.t 2010/02/23 18:59:42 80 +++ t/koha/02-create-test-user.t 2010/11/16 18:07:05 101 @@ -5,7 +5,6 @@ use Test::More tests => 4; use Test::WWW::Mechanize; -use File::Slurp; our $config; require 't/config.pl'; @@ -15,13 +14,18 @@ my $mech = Test::WWW::Mechanize->new; my $save_count = 1; -sub save { write_file "/tmp/login-$save_count.html", @_; $save_count++; } +sub save { + my $path = '/tmp/login-' . $save_count++ . '.html'; + open(my $fh, '>', $path); + print $fh @_; + warn "# save $path ", -s $path, " bytes\n"; +} $mech->get_ok( 'https://localhost', 'opac' ); save $mech->content; -$mech->follow_link_ok({ text_regex => qr/Log in to Your Account/i }, 'login form' ); +$mech->follow_link_ok({ url_regex => qr/opac-user/i }, 'login form' ); save $mech->content; $mech->submit_form_ok({