Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 29 additions & 9 deletions spec/features/idv/outage_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,34 @@ def sign_in_with_idv_required(user:, sms_or_totp: :sms)
let(:feature_idv_force_gpo_verification_enabled) { false }
let(:feature_idv_hybrid_flow_enabled) { true }

before do
# Wire up various let()s to configuration keys
let(:vendors) do
%w[
acuant
lexisnexis_instant_verify
lexisnexis_phone_finder
lexisnexis_trueid
sms
voice
].each do |service|
vendor_status_key = "vendor_status_#{service}".to_sym
allow(IdentityConfig.store).to receive(vendor_status_key).
and_return(send(vendor_status_key))
end
]
end

let(:config_flags) do
%w[
enable_usps_verification
feature_idv_force_gpo_verification_enabled
feature_idv_hybrid_flow_enabled
].each do |key|
]
end

before do
# Wire up various let()s to configuration keys
vendors.each do |service|
vendor_status_key = "vendor_status_#{service}".to_sym
allow(IdentityConfig.store).to receive(vendor_status_key).
and_return(send(vendor_status_key))
end

config_flags.each do |key|
allow(IdentityConfig.store).to receive(key).
and_return(send(key))
end
Expand All @@ -61,7 +69,19 @@ def sign_in_with_idv_required(user:, sms_or_totp: :sms)
end

after do
# Don't leave stale routes sitting around.
# Don't leave stale routes sitting around!
# - Reset all the feature flags that could cause route changes
# - Reload routes to reset the environment for any specs that run next

vendors.each do |service|
vendor_status_key = "vendor_status_#{service}".to_sym
allow(IdentityConfig.store).to receive(vendor_status_key).and_call_original
end

config_flags.each do |key|
allow(IdentityConfig.store).to receive(key).and_call_original
end

Rails.application.reload_routes!
end

Expand Down