record amr for stat

This commit is contained in:
simon lehericey 2024-09-16 14:41:15 +02:00
parent 47852bfafb
commit 05238912cf
No known key found for this signature in database
GPG key ID: CDE670D827C7B3C5
2 changed files with 2 additions and 1 deletions

View file

@ -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)

View file

@ -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