Merge pull request #7185 from tchak/fix-exclude-auto_archive_on-from-clone
fix(procedure): cloned procedure should not have auto_archive_on
This commit is contained in:
commit
f70344b89b
2 changed files with 3 additions and 1 deletions
|
@ -464,6 +464,7 @@ class Procedure < ApplicationRecord
|
|||
procedure.closed_at = nil
|
||||
procedure.unpublished_at = nil
|
||||
procedure.published_at = nil
|
||||
procedure.auto_archive_on = nil
|
||||
procedure.lien_notice = nil
|
||||
procedure.published_revision = nil
|
||||
procedure.draft_revision.procedure = procedure
|
||||
|
|
|
@ -603,12 +603,13 @@ describe Procedure do
|
|||
end
|
||||
|
||||
describe 'procedure status is reset' do
|
||||
let(:procedure) { create(:procedure, :closed, received_mail: received_mail, service: service) }
|
||||
let(:procedure) { create(:procedure, :closed, received_mail: received_mail, service: service, auto_archive_on: 3.weeks.from_now) }
|
||||
|
||||
it 'Not published nor closed' do
|
||||
expect(subject.closed_at).to be_nil
|
||||
expect(subject.published_at).to be_nil
|
||||
expect(subject.unpublished_at).to be_nil
|
||||
expect(subject.auto_archive_on).to be_nil
|
||||
expect(subject.aasm_state).to eq "brouillon"
|
||||
expect(subject.path).not_to be_nil
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue