Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions spec/controllers/idv/personal_key_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def index

expect(@analytics).to have_logged_event(
'IdV: personal key submitted',
address_verification_method: nil,
address_verification_method: 'phone',
fraud_review_pending: false,
fraud_rejection: false,
in_person_verification_pending: false,
Expand Down Expand Up @@ -249,7 +249,7 @@ def index

expect(@analytics).to have_logged_event(
'IdV: personal key submitted',
address_verification_method: nil,
address_verification_method: 'phone',
fraud_review_pending: false,
fraud_rejection: false,
deactivation_reason: nil,
Expand Down Expand Up @@ -277,7 +277,7 @@ def index

expect(@analytics).to have_logged_event(
'IdV: personal key submitted',
address_verification_method: nil,
address_verification_method: 'phone',
fraud_review_pending: false,
fraud_rejection: false,
in_person_verification_pending: false,
Expand Down Expand Up @@ -306,7 +306,7 @@ def index
'IdV: personal key submitted',
fraud_review_pending: true,
fraud_rejection: false,
address_verification_method: nil,
address_verification_method: 'phone',
in_person_verification_pending: false,
deactivation_reason: nil,
proofing_components: nil,
Expand Down
3 changes: 0 additions & 3 deletions spec/controllers/idv/review_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -620,9 +620,6 @@ def show
let(:applicant) do
Idp::Constants::MOCK_IDV_APPLICANT_WITH_PHONE
end
let(:stub_idv_session) do
stub_user_with_applicant_data(user, applicant)
end

before do
allow(IdentityConfig.store).to receive(:proofing_device_profiling).
Expand Down
19 changes: 3 additions & 16 deletions spec/support/controller_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ def sign_in_before_2fa(user = create(:user, :fully_registered))
def stub_sign_in(user = build(:user, password: VALID_PASSWORD))
allow(request.env['warden']).to receive(:authenticate!).and_return(user)
allow(request.env['warden']).to receive(:session).and_return(user: {})
allow(controller).to receive(:user_session).and_return(authn_at: Time.zone.now)
allow(controller).to receive(:user_session).
and_return({ authn_at: Time.zone.now }.with_indifferent_access)
controller.user_session[:auth_method] ||= TwoFactorAuthenticatable::AuthMethod::SMS
allow(controller).to receive(:current_user).and_return(user)
allow(controller).to receive(:confirm_two_factor_authenticated).and_return(true)
Expand Down Expand Up @@ -54,7 +55,7 @@ def stub_idv_steps_before_verify_step(user)
end

def stub_verify_steps_one_and_two(user)
user_session = {}
user_session = ActiveSupport::HashWithIndifferentAccess.new
stub_sign_in(user)
idv_session = Idv::Session.new(
user_session: user_session, current_user: user,
Expand All @@ -73,20 +74,6 @@ def stub_verify_steps_one_and_two(user)
allow(subject).to receive(:user_session).and_return(user_session)
end

def stub_user_with_applicant_data(user, applicant)
user_session = {}
stub_sign_in(user)
idv_session = Idv::Session.new(
user_session: user_session, current_user: user,
service_provider: nil
)
idv_session.applicant = applicant.with_indifferent_access
idv_session.resolution_successful = true
allow(subject).to receive(:confirm_idv_applicant_created).and_return(true)
allow(subject).to receive(:idv_session).and_return(idv_session)
allow(subject).to receive(:user_session).and_return(user_session)
end

def stub_user_with_pending_profile(user)
allow(user).to receive(:pending_profile).and_return(pending_profile)
allow(user).to receive(:gpo_verification_pending_profile?).
Expand Down