diff options
Diffstat (limited to 't/cobrand/tfl.t')
-rw-r--r-- | t/cobrand/tfl.t | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/t/cobrand/tfl.t b/t/cobrand/tfl.t index 9df9a3d6c..e37a0192f 100644 --- a/t/cobrand/tfl.t +++ b/t/cobrand/tfl.t @@ -512,6 +512,36 @@ subtest 'Bromley staff cannot access TfL admin' => sub { $mech->log_out_ok; }; +subtest 'Test passwords work appropriately' => sub { + $mech->host('www.fixmystreet.com'); + $mech->get_ok('/auth'); + $user->password('dotcom'); + $user->update; + $mech->submit_form_ok( + { with_fields => { username => $user->email, password_sign_in => 'dotcom' } }, + "sign in using form" ); + $mech->content_contains('Your account'); + $mech->host('tfl.fixmystreet.com'); + $mech->get_ok('/auth'); + $mech->submit_form_ok( + { with_fields => { username => $user->email, password_sign_in => 'dotcom' } }, + "sign in using form" ); + $mech->content_lacks('Your account'); + + $user->password('tfl'); + $user->update; + $mech->submit_form_ok( + { with_fields => { username => $user->email, password_sign_in => 'tfl' } }, + "sign in using form" ); + $mech->content_contains('Your account'); + $mech->host('www.fixmystreet.com'); + $mech->get_ok('/auth'); + $mech->submit_form_ok( + { with_fields => { username => $user->email, password_sign_in => 'tfl' } }, + "sign in using form" ); + $mech->content_lacks('Your account'); +}; + }; FixMyStreet::override_config { |