Retain 640 character limit

This commit is contained in:
Mike Barnes 2024-09-24 20:20:58 +10:00
commit d2ba53bc3f
3 changed files with 10 additions and 6 deletions

View file

@ -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)