Skip to content

Commit

Permalink
record amr for stat
Browse files Browse the repository at this point in the history
  • Loading branch information
LeSim committed Sep 18, 2024
1 parent 47852bf commit 0523891
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/agent_connect/agent_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def callback
instructeur.user.update!(email_verified_at: Time.zone.now)

aci = AgentConnectInformation.find_or_initialize_by(instructeur:, sub: user_info['sub'])
aci.update(user_info.slice('given_name', 'usual_name', 'email', 'sub', 'siret', 'organizational_unit', 'belonging_population', 'phone'))
aci.update(user_info.slice('given_name', 'usual_name', 'email', 'sub', 'siret', 'organizational_unit', 'belonging_population', 'phone').merge(amr:))

sign_in(:user, instructeur.user)

Expand Down
1 change: 1 addition & 0 deletions spec/controllers/agent_connect/agent_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
expect { subject }.to change { User.count }.by(1).and change { Instructeur.count }.by(1)

expect(controller).to have_received(:sign_in)
expect(User.last.instructeur.agent_connect_information.last.amr).to eq(amr)
end
end
end
Expand Down

0 comments on commit 0523891

Please sign in to comment.