[fix #2813] set lien_notice nil when clone a procedure
This commit is contained in:
parent
c12586f522
commit
f70f276ae9
2 changed files with 7 additions and 0 deletions
|
@ -214,6 +214,7 @@ class Procedure < ApplicationRecord
|
||||||
procedure.published_at = nil
|
procedure.published_at = nil
|
||||||
procedure.logo_secure_token = nil
|
procedure.logo_secure_token = nil
|
||||||
procedure.remote_logo_url = self.logo_url
|
procedure.remote_logo_url = self.logo_url
|
||||||
|
procedure.lien_notice = nil
|
||||||
|
|
||||||
[:notice, :deliberation].each { |attachment| clone_attachment(procedure, attachment) }
|
[:notice, :deliberation].each { |attachment| clone_attachment(procedure, attachment) }
|
||||||
|
|
||||||
|
|
|
@ -413,6 +413,12 @@ describe Procedure do
|
||||||
expect(subject.assign_to).to eq([])
|
expect(subject.assign_to).to eq([])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'should not duplicate lien_notice' do
|
||||||
|
let(:procedure) { create(:procedure, lien_notice: "http://toto.com") }
|
||||||
|
|
||||||
|
it { expect(subject.lien_notice).to be_nil }
|
||||||
|
end
|
||||||
|
|
||||||
describe 'procedure status is reset' do
|
describe 'procedure status is reset' do
|
||||||
let(:procedure) { create(:procedure, :archived, received_mail: received_mail, service: service) }
|
let(:procedure) { create(:procedure, :archived, received_mail: received_mail, service: service) }
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue