Merge pull request #5096 from betagouv/ne-clone-pas-token

don't copy api_entreprise_token when cloning
This commit is contained in:
Paul Chavard 2020-04-29 18:04:07 +02:00 committed by GitHub
commit 60998f410d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View file

@ -306,6 +306,7 @@ class Procedure < ApplicationRecord
if is_different_admin
procedure.administrateurs = [admin]
procedure.api_entreprise_token = nil
else
procedure.administrateurs = administrateurs
end

View file

@ -461,6 +461,10 @@ describe Procedure do
end
end
it 'should discard specific api_entreprise_token' do
expect(subject.read_attribute(:api_entreprise_token)).to be_nil
end
it 'should have one administrateur' do
expect(subject.administrateurs).to eq([administrateur])
end