fix tests that now requir an admin user to have a strong password

This commit is contained in:
clemkeirua 2020-09-18 09:57:26 +02:00
parent d8b4cc67be
commit 2b23eefee2
4 changed files with 7 additions and 3 deletions

View file

@ -25,7 +25,7 @@ describe WebhookController, type: :controller do
end
context 'when there is a matching user' do
let(:user) { create(:user) }
let(:user) { create(:user, :with_strong_password) }
let(:customer_email) { user.email }
it 'returns a 200 response' do

View file

@ -3,7 +3,7 @@ FactoryBot.define do
factory :administrateur do
transient do
email { generate(:administrateur_email) }
password { 'mon chien aime les bananes' }
password { 'Mon [hien 4im3 {es banane$' }
end
initialize_with do

View file

@ -8,5 +8,9 @@ FactoryBot.define do
trait :unconfirmed do
confirmed_at { nil }
end
trait :with_strong_password do
password { '{my-%s3cure[]-p4$$w0rd' }
end
end
end

View file

@ -36,7 +36,7 @@ describe AdministrateurUsageStatisticsService do
context 'for an administrateur that has plenty of things' do
let(:administrateur) do
create(:administrateur,
user: create(:user, sign_in_count: 17, current_sign_in_at: Time.zone.local(2019, 3, 7), last_sign_in_at: Time.zone.local(2019, 2, 27)),
user: create(:user, :with_strong_password, sign_in_count: 17, current_sign_in_at: Time.zone.local(2019, 3, 7), last_sign_in_at: Time.zone.local(2019, 2, 27)),
services: [create(:service)],
instructeurs: [create(:instructeur)])
end