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:
Paul Chavard 2022-04-22 10:55:53 +02:00 committed by GitHub
commit f70344b89b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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