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
4 changes: 2 additions & 2 deletions app/controllers/idv/personal_key_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def update
fraud_review_pending: fraud_review_pending?,
fraud_rejection: fraud_rejection?,
)
idv_session.personal_key = nil
redirect_to next_step
end

Expand Down Expand Up @@ -63,8 +64,7 @@ def finish_idv_session
@code = personal_key
@personal_key_generated_at = current_user.personal_key_generated_at

user_session[:personal_key] = @code
idv_session.personal_key = nil
idv_session.personal_key = @code

irs_attempts_api_tracker.idv_personal_key_generated
end
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/accounts_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

RSpec.describe AccountsController do
describe 'before_actions' do
it 'includes before_actions from AccountStateChecker' do
it 'includes before_actions' do
expect(subject).to have_actions(
:before,
:confirm_two_factor_authenticated,
Expand Down
12 changes: 11 additions & 1 deletion spec/controllers/idv/personal_key_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def stub_idv_session
end

describe 'before_actions' do
it 'includes before_actions from AccountStateChecker' do
it 'includes before_actions' do
expect(subject).to have_actions(
:before,
:confirm_two_factor_authenticated,
Expand Down Expand Up @@ -138,6 +138,16 @@ def index
expect(assigns(:code)).to eq(code)
end

it 'shows the same personal key when page is refreshed' do
subject.idv_session.create_profile_from_applicant_with_password(password)
code = subject.idv_session.personal_key

get :show
get :show
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I would have had to write an expensive feature test for this.


expect(assigns(:code)).to eq(code)
end

it 'can decrypt the profile with the code' do
get :show

Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/idv/review_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
end

describe 'before_actions' do
it 'includes before_actions from AccountStateChecker' do
it 'includes before_actions' do
expect(subject).to have_actions(
:before,
:confirm_two_factor_authenticated,
Expand Down