Merge pull request #4826 from tchak/fix-canonical-clone
Administrateur : cloner une démarche supprime son lien à des révisions précédentes de la démarche
This commit is contained in:
commit
e4532500f0
2 changed files with 10 additions and 0 deletions
|
@ -295,6 +295,7 @@ class Procedure < ApplicationRecord
|
||||||
|
|
||||||
procedure.cloned_from_library = from_library
|
procedure.cloned_from_library = from_library
|
||||||
procedure.parent_procedure = self
|
procedure.parent_procedure = self
|
||||||
|
procedure.canonical_procedure = nil
|
||||||
|
|
||||||
if from_library
|
if from_library
|
||||||
procedure.service = nil
|
procedure.service = nil
|
||||||
|
|
|
@ -538,6 +538,15 @@ describe Procedure do
|
||||||
expect(subject.deliberation.attached?).to be true
|
expect(subject.deliberation.attached?).to be true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'with canonical procedure' do
|
||||||
|
let(:canonical_procedure) { create(:procedure) }
|
||||||
|
let(:procedure) { create(:procedure, canonical_procedure: canonical_procedure, received_mail: received_mail, service: service) }
|
||||||
|
|
||||||
|
it 'do not clone canonical procedure' do
|
||||||
|
expect(subject.canonical_procedure).to be_nil
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#publish!' do
|
describe '#publish!' do
|
||||||
|
|
Loading…
Reference in a new issue