diff options
author | Struan Donald <struan@exo.org.uk> | 2011-06-27 09:18:18 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-06-27 09:18:18 +0100 |
commit | b483a17c13ba8e273949ce4ee8c8c05e66b06647 (patch) | |
tree | 3e928fa68c3edb90c0666ec52ad8c9982f9dab77 /perllib/FixMyStreet/TestMech.pm | |
parent | 8deb709fa2d44bcbaba54734f7f4f4385980d8df (diff) | |
parent | 62ffebc89cc66d32a828ea1de8c850c3e950faa1 (diff) |
Merge branch 'master' of ssh://git.mysociety.org/data/git/public/fixmystreet into new_statuses
Conflicts:
perllib/FixMyStreet/DB/Result/Comment.pm
perllib/FixMyStreet/DB/Result/User.pm
web/css/core.css
Diffstat (limited to 'perllib/FixMyStreet/TestMech.pm')
-rw-r--r-- | perllib/FixMyStreet/TestMech.pm | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/perllib/FixMyStreet/TestMech.pm b/perllib/FixMyStreet/TestMech.pm index 3dd4e84e9..1391254b6 100644 --- a/perllib/FixMyStreet/TestMech.pm +++ b/perllib/FixMyStreet/TestMech.pm @@ -14,7 +14,6 @@ use Test::More; use Web::Scraper; use Carp; use Email::Send::Test; -use Digest::SHA1 'sha1_hex'; use JSON; =head1 NAME @@ -89,18 +88,18 @@ sub log_in_ok { my $user = $mech->create_user_ok($email); # store the old password and then change it - my $old_password_sha1 = $user->password; - $user->update( { password => sha1_hex('secret') } ); + my $old_password = $user->password; + $user->update( { password => 'secret' } ); # log in $mech->get_ok('/auth'); $mech->submit_form_ok( - { with_fields => { email => $email, password => 'secret' } }, - "login using form" ); + { with_fields => { email => $email, password_sign_in => 'secret' } }, + "sign in using form" ); $mech->logged_in_ok; # restore the password (if there was one) - $user->update( { password => $old_password_sha1 } ) if $old_password_sha1; + $user->update( { password => $old_password } ) if $old_password; return $user; } @@ -115,7 +114,7 @@ Log out the current user sub log_out_ok { my $mech = shift; - $mech->get_ok('/auth/logout'); + $mech->get_ok('/auth/sign_out'); $mech->not_logged_in_ok; } |