fix(attestation): dup keep all attributes
This commit is contained in:
parent
c5c24c01d8
commit
4af6957237
2 changed files with 6 additions and 4 deletions
|
@ -96,7 +96,7 @@ class AttestationTemplate < ApplicationRecord
|
|||
end
|
||||
|
||||
def dup
|
||||
attestation_template = AttestationTemplate.new(title: title, body: body, footer: footer, activated: activated)
|
||||
attestation_template = super
|
||||
ClonePiecesJustificativesService.clone_attachments(self, attestation_template)
|
||||
attestation_template
|
||||
end
|
||||
|
|
|
@ -21,9 +21,11 @@ describe AttestationTemplate, type: :model do
|
|||
context 'with an attestation without images' do
|
||||
let(:attributes) { attributes_for(:attestation_template) }
|
||||
|
||||
it { is_expected.to have_attributes(attributes) }
|
||||
it { is_expected.to have_attributes(id: nil) }
|
||||
it { expect(subject.logo.attached?).to be_falsey }
|
||||
it "works" do
|
||||
is_expected.to have_attributes(attributes)
|
||||
is_expected.to have_attributes(id: nil)
|
||||
expect(subject.logo.attached?).to be_falsey
|
||||
end
|
||||
end
|
||||
|
||||
context 'with an attestation with images' do
|
||||
|
|
Loading…
Reference in a new issue