record amr for stat
This commit is contained in:
parent
47852bfafb
commit
05238912cf
2 changed files with 2 additions and 1 deletions
|
@ -50,7 +50,7 @@ class AgentConnect::AgentController < ApplicationController
|
|||
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)
|
||||
|
||||
|
|
|
@ -67,6 +67,7 @@ describe AgentConnect::AgentController, type: :controller do
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue