diff options
author | Matthew Somerville <matthew@mysociety.org> | 2020-07-08 07:43:01 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2020-07-08 07:43:01 +0100 |
commit | ee0d396b21045ddc8daf16a339f0eef8fe3c555f (patch) | |
tree | 3bd8c14cd42cd69eac1c6754ad26d5bde4891af4 /t/app/controller | |
parent | 8070a8493decdf4f9dc7eada086f2772f6b810f8 (diff) | |
parent | 9a12c0dac0b7677938f33f5abb639a296adff9c5 (diff) |
Merge branch 'hibp'
Diffstat (limited to 't/app/controller')
-rw-r--r-- | t/app/controller/auth.t | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/t/app/controller/auth.t b/t/app/controller/auth.t index 8b4b772fc..0326bbacd 100644 --- a/t/app/controller/auth.t +++ b/t/app/controller/auth.t @@ -288,6 +288,23 @@ subtest 'check common password AJAX call' => sub { $mech->content_contains("true"); }; +subtest 'check hibp password call' => sub { + FixMyStreet::override_config { + CHECK_HAVEIBEENPWNED => 1, + }, sub { + my $lwp = Test::MockModule->new('LWP::Simple'); + # Switch mock round from live site, so we know we're not testing live site by mistake + $lwp->mock(get => sub($) { + return '9958D0F0EE6744E7CCAFC84515FCFAD7B1B:10' if $_[0] =~ /6EF4D$/; # squirblewirble + return ''; + }); + $mech->post_ok('/auth/common_password', { password_register => 'p@ssword2' }); + $mech->content_contains("true"); + $mech->post_ok('/auth/common_password', { password_register => 'squirblewirble' }); + $mech->content_contains("That password has appeared in a known"); + }; +}; + subtest 'test forgotten password page' => sub { $mech->get_ok('/auth/forgot'); $mech->content_contains('Forgot password'); |