Extract TEXT_LENGTH_LIMIT
constant in Appeal
class (#30638)
This commit is contained in:
parent
28921a12fe
commit
9bf2e2eda0
2 changed files with 16 additions and 1 deletions
|
@ -3,6 +3,19 @@
|
|||
require 'rails_helper'
|
||||
|
||||
describe Appeal do
|
||||
describe 'Validations' do
|
||||
it 'validates text length is under limit' do
|
||||
appeal = Fabricate.build(
|
||||
:appeal,
|
||||
strike: Fabricate(:account_warning),
|
||||
text: 'a' * described_class::TEXT_LENGTH_LIMIT * 2
|
||||
)
|
||||
|
||||
expect(appeal).to_not be_valid
|
||||
expect(appeal).to model_have_error_on_field(:text)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'scopes' do
|
||||
describe 'approved' do
|
||||
let(:approved_appeal) { Fabricate(:appeal, approved_at: 10.days.ago) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue