super_admin: check password complexity client side

This commit is contained in:
Christophe Robillard 2020-11-17 16:20:27 +01:00 committed by simon lehericey
parent 90d7ee872e
commit 94b3ec942b
4 changed files with 32 additions and 4 deletions

View file

@ -0,0 +1,12 @@
describe SuperAdmins::PasswordsController, type: :controller do
describe '#test_strength' do
it 'calculate score' do
password = "bonjour"
@request.env["devise.mapping"] = Devise.mappings[:super_admin]
get 'test_strength', xhr: true, params: { super_admin: { password: password } }
expect(assigns(:score)).to be_present
end
end
end