Merge pull request #5096 from betagouv/ne-clone-pas-token
don't copy api_entreprise_token when cloning
This commit is contained in:
commit
60998f410d
2 changed files with 5 additions and 0 deletions
|
@ -306,6 +306,7 @@ class Procedure < ApplicationRecord
|
|||
|
||||
if is_different_admin
|
||||
procedure.administrateurs = [admin]
|
||||
procedure.api_entreprise_token = nil
|
||||
else
|
||||
procedure.administrateurs = administrateurs
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue