specs: use Instructeur.bypass_email_login_token in the tests
This commit is contained in:
parent
ac07f05771
commit
8b3d31980a
3 changed files with 3 additions and 5 deletions
|
@ -2,6 +2,8 @@ FactoryBot.define do
|
||||||
sequence(:instructeur_email) { |n| "inst#{n}@inst.com" }
|
sequence(:instructeur_email) { |n| "inst#{n}@inst.com" }
|
||||||
|
|
||||||
factory :instructeur do
|
factory :instructeur do
|
||||||
|
bypass_email_login_token { true }
|
||||||
|
|
||||||
user { association :user, email: email, password: password }
|
user { association :user, email: email, password: password }
|
||||||
|
|
||||||
transient do
|
transient do
|
||||||
|
|
|
@ -89,10 +89,6 @@ RSpec.configure do |config|
|
||||||
Geocoder.configure(lookup: :test)
|
Geocoder.configure(lookup: :test)
|
||||||
end
|
end
|
||||||
|
|
||||||
config.before(:each) do
|
|
||||||
Flipper.enable(:instructeur_bypass_email_login_token)
|
|
||||||
end
|
|
||||||
|
|
||||||
# By default, forgery protection is disabled in the test environment.
|
# By default, forgery protection is disabled in the test environment.
|
||||||
# (See `config.action_controller.allow_forgery_protection` in `config/test.rb`)
|
# (See `config.action_controller.allow_forgery_protection` in `config/test.rb`)
|
||||||
#
|
#
|
||||||
|
|
|
@ -17,7 +17,7 @@ module SystemHelpers
|
||||||
fill_in :user_password, with: password
|
fill_in :user_password, with: password
|
||||||
|
|
||||||
if sign_in_by_link
|
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
|
end
|
||||||
|
|
||||||
perform_enqueued_jobs do
|
perform_enqueued_jobs do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue