update default zones after admin creation

This commit is contained in:
Christophe Robillard 2023-04-05 12:36:11 +02:00
parent ca922005f9
commit b13e77650e
2 changed files with 5 additions and 0 deletions

View file

@ -139,6 +139,7 @@ class User < ApplicationRecord
if user.valid? && user.administrateur.nil?
user.create_administrateur!
user.update(france_connect_information: nil)
AdminUpdateDefaultZonesJob.perform_later(user.administrateur)
end
user

View file

@ -6,6 +6,10 @@ describe 'As an administrateur', js: true do
let(:strong_password) { 'a new, long, and complicated password!' }
before do
body = "{\"hs\": \"agent.educpop.gouv.fr\" }"
WebMock.stub_request(:get, /https:\/\/matrix.agent.tchap.gouv.fr\/_matrix\/identity\/api\/v1\/info\?address=(.*)&medium=email/)
.to_return(body: body, status: 200)
perform_enqueued_jobs do
super_admin.invite_admin(admin_email)
end