[Fix #499] Attestation: add maxlength to footer
This commit is contained in:
parent
81984d2883
commit
3d99407495
4 changed files with 21 additions and 1 deletions
|
@ -40,6 +40,21 @@ describe AttestationTemplate, type: :model do
|
|||
end
|
||||
end
|
||||
|
||||
describe 'validates footer length' do
|
||||
let(:attestation_template) { AttestationTemplate.new(footer: footer) }
|
||||
|
||||
subject do
|
||||
attestation_template.validate
|
||||
attestation_template.errors.details
|
||||
end
|
||||
|
||||
context 'when the footer is too long' do
|
||||
let(:footer) { 'a' * 191 }
|
||||
|
||||
it { is_expected.to match({ footer: [{ error: :too_long, count: 190 }] }) }
|
||||
end
|
||||
end
|
||||
|
||||
describe 'dup' do
|
||||
before do
|
||||
@logo = File.open('spec/fixtures/white.png')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue