/[virtual-ldap]/t/koha/02-create-test-user.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /t/koha/02-create-test-user.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 100 by dpavlin, Tue Feb 23 19:40:01 2010 UTC revision 101 by dpavlin, Tue Nov 16 18:07:05 2010 UTC
# Line 5  use strict; Line 5  use strict;
5    
6  use Test::More tests => 4;  use Test::More tests => 4;
7  use Test::WWW::Mechanize;  use Test::WWW::Mechanize;
 use File::Slurp;  
8    
9  our $config;  our $config;
10  require 't/config.pl';  require 't/config.pl';
# Line 17  my $mech = Test::WWW::Mechanize->new; Line 16  my $mech = Test::WWW::Mechanize->new;
16  my $save_count = 1;  my $save_count = 1;
17  sub save {  sub save {
18          my $path = '/tmp/login-' . $save_count++ . '.html';          my $path = '/tmp/login-' . $save_count++ . '.html';
19          write_file $path, @_;          open(my $fh, '>', $path);
20            print $fh @_;
21          warn "# save $path ", -s $path, " bytes\n";          warn "# save $path ", -s $path, " bytes\n";
22  }  }
23                    
# Line 25  sub save { Line 25  sub save {
25  $mech->get_ok( 'https://localhost', 'opac' );  $mech->get_ok( 'https://localhost', 'opac' );
26  save $mech->content;  save $mech->content;
27    
28  $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' );
29  save $mech->content;  save $mech->content;
30    
31  $mech->submit_form_ok({  $mech->submit_form_ok({

Legend:
Removed from v.100  
changed lines
  Added in v.101

  ViewVC Help
Powered by ViewVC 1.1.26