fix(procedure): cloned procedure should not have auto_archive_on

fix #7149
This commit is contained in:
Paul Chavard 2022-04-21 17:39:03 +02:00
parent 3789e5d02b
commit 23b60c87e9
2 changed files with 3 additions and 1 deletions

View file

@ -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

View file

@ -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