Retain 640 character limit
This commit is contained in:
parent
9bcb7630b3
commit
d2ba53bc3f
3 changed files with 10 additions and 6 deletions
|
|
@ -3,11 +3,11 @@
|
|||
require 'rails_helper'
|
||||
|
||||
describe NoteLengthValidator do
|
||||
subject { described_class.new(attributes: { note: true }, maximum: 500) }
|
||||
subject { described_class.new(attributes: { note: true }, maximum: 640) }
|
||||
|
||||
describe '#validate' do
|
||||
it 'adds an error when text is over 500 characters' do
|
||||
text = 'a' * 520
|
||||
it 'adds an error when text is over 640 characters' do
|
||||
text = 'a' * 650
|
||||
account = instance_double(Account, note: text, errors: activemodel_errors)
|
||||
|
||||
subject.validate_each(account, 'note', text)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue