specs: use Instructeur.bypass_email_login_token in the tests

This commit is contained in:
Pierre de La Morinerie 2021-11-25 15:38:01 +01:00
parent ac07f05771
commit 8b3d31980a
3 changed files with 3 additions and 5 deletions

View file

@ -2,6 +2,8 @@ FactoryBot.define do
sequence(:instructeur_email) { |n| "inst#{n}@inst.com" }
factory :instructeur do
bypass_email_login_token { true }
user { association :user, email: email, password: password }
transient do

View file

@ -89,10 +89,6 @@ RSpec.configure do |config|
Geocoder.configure(lookup: :test)
end
config.before(:each) do
Flipper.enable(:instructeur_bypass_email_login_token)
end
# By default, forgery protection is disabled in the test environment.
# (See `config.action_controller.allow_forgery_protection` in `config/test.rb`)
#

View file

@ -17,7 +17,7 @@ module SystemHelpers
fill_in :user_password, with: password
if sign_in_by_link
Flipper.disable(:instructeur_bypass_email_login_token)
User.find_by(email: email)&.instructeur&.update!(bypass_email_login_token: false)
end
perform_enqueued_jobs do