aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/auth_profile.t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-02-06 17:03:46 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-02-06 22:53:30 +0000
commit1e301bf1e07daf35150d54b132bbbe66f0a8095e (patch)
treeeb7fa1be4b978cb16b70b7346aa100627e3ebc07 /t/app/controller/auth_profile.t
parent6edf79cb0ecd150ea0f054c8faa7be0b055fc2d0 (diff)
parent3e201f8d48554ab8c4b8132eaa50b5fe7dd1d67e (diff)
Merge branch 'password-tests'
Diffstat (limited to 't/app/controller/auth_profile.t')
-rw-r--r--t/app/controller/auth_profile.t16
1 files changed, 15 insertions, 1 deletions
diff --git a/t/app/controller/auth_profile.t b/t/app/controller/auth_profile.t
index 6040406ef..de2ad6534 100644
--- a/t/app/controller/auth_profile.t
+++ b/t/app/controller/auth_profile.t
@@ -8,7 +8,7 @@ LWP::Protocol::PSGI->register($twilio->to_psgi_app, host => 'api.twilio.com');
my $test_email = 'test@example.com';
my $test_email2 = 'test@example.net';
-my $test_password = 'foobar';
+my $test_password = 'foobar123';
END {
done_testing();
@@ -147,6 +147,20 @@ subtest "Test change password page with current password" => sub {
ok $user->password, "user now has a password";
};
+subtest 'check password length/common' => sub {
+ $mech->get_ok('/auth/change_password');
+ $mech->submit_form_ok({
+ form_name => 'change_password',
+ fields => { current_password => $test_password, new_password => 'short', confirm => 'short' },
+ });
+ $mech->content_contains("Please make sure your password is at least");
+ $mech->submit_form_ok({
+ form_name => 'change_password',
+ fields => { current_password => $test_password, new_password => 'common', confirm => 'common' },
+ });
+ $mech->content_contains("Please choose a less commonly-used password");
+};
+
subtest "Test change email page" => sub {
$mech->create_problems_for_body(1, 2514, 'Title1', { user => FixMyStreet::DB->resultset('User')->find( { email => $test_email } ) } );