Skip to content

Commit

Permalink
[12929] Properly adding idme_uuid as a field when user model is reloa…
Browse files Browse the repository at this point in the history
…ded (#12930)

Co-authored-by: Trevor Bosaw <trevor.bosaw@oddball.io>
  • Loading branch information
bosawt and Trevor Bosaw authored Jun 8, 2023
1 parent ed97e30 commit e827b1e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/services/sign_in/user_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def validate_account_and_session
def user_attributes
{
mhv_icn: session.user_account.icn,
idme_uuid: user_verification.idme_uuid,
idme_uuid: user_verification.idme_uuid || user_verification.backing_idme_uuid,
logingov_uuid: user_verification.logingov_uuid,
loa:,
email: session.credential_email,
Expand Down
16 changes: 16 additions & 0 deletions spec/services/sign_in/user_loader_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,22 @@
stub_mpi(build(:mpi_profile, edipi:, icn: user_icn))
end

context 'and user is authenticated with dslogon' do
let(:user_verification) { create(:dslogon_user_verification, user_account:) }

it 'reloads user object with expected backing idme uuid' do
expect(subject.idme_uuid).to eq user_verification.backing_idme_uuid
end
end

context 'and user is authenticated with mhv' do
let(:user_verification) { create(:mhv_user_verification, user_account:) }

it 'reloads user object with expected backing idme uuid' do
expect(subject.idme_uuid).to eq user_verification.backing_idme_uuid
end
end

it 'reloads user object with expected attributes' do
reloaded_user = subject

Expand Down

0 comments on commit e827b1e

Please sign in to comment.