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
|
end
|
||||||
|
|
||||||
def dup
|
def dup
|
||||||
attestation_template = AttestationTemplate.new(title: title, body: body, footer: footer, activated: activated)
|
attestation_template = super
|
||||||
ClonePiecesJustificativesService.clone_attachments(self, attestation_template)
|
ClonePiecesJustificativesService.clone_attachments(self, attestation_template)
|
||||||
attestation_template
|
attestation_template
|
||||||
end
|
end
|
||||||
|
|
|
@ -21,9 +21,11 @@ describe AttestationTemplate, type: :model do
|
||||||
context 'with an attestation without images' do
|
context 'with an attestation without images' do
|
||||||
let(:attributes) { attributes_for(:attestation_template) }
|
let(:attributes) { attributes_for(:attestation_template) }
|
||||||
|
|
||||||
it { is_expected.to have_attributes(attributes) }
|
it "works" do
|
||||||
it { is_expected.to have_attributes(id: nil) }
|
is_expected.to have_attributes(attributes)
|
||||||
it { expect(subject.logo.attached?).to be_falsey }
|
is_expected.to have_attributes(id: nil)
|
||||||
|
expect(subject.logo.attached?).to be_falsey
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with an attestation with images' do
|
context 'with an attestation with images' do
|
||||||
|
|
Loading…
Reference in a new issue