X-Git-Url: http://git.rot13.org/?p=virtual-ldap;a=blobdiff_plain;f=t%2Fkoha%2F02-create-test-user.t;h=afcb887cc8b099a095947975499a072c212a9be5;hp=3eaa708b90f238dd9ed444b3ccdbbfc8b9af48f9;hb=de4af466676c72f0c57d1c3dab83a8ef07c92cda;hpb=5b0b2bd4647411e7d388c09e215927f5dc035423 diff --git a/t/koha/02-create-test-user.t b/t/koha/02-create-test-user.t index 3eaa708..afcb887 100755 --- a/t/koha/02-create-test-user.t +++ b/t/koha/02-create-test-user.t @@ -5,7 +5,6 @@ use strict; use Test::More tests => 4; use Test::WWW::Mechanize; -use File::Slurp; our $config; require 't/config.pl'; @@ -15,13 +14,19 @@ use WWW::Mechanize; 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' ); +my $opac_url = $ENV{OPAC_URL} || 'http://ffzg.koha-dev.rot13.org'; + +$mech->get_ok( $opac_url, "opac $opac_url" ); 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({