Simplify model validation specs for `CustomFilter`

Matt Jankowski 2024-09-05 13:44:08 -04:00
parent a1ac2a73ff
commit 35378da53c
1 changed files with 1 additions and 13 deletions

View File

@ -7,19 +7,7 @@ RSpec.describe CustomFilter do
it { is_expected.to validate_presence_of(:title) }
it { is_expected.to validate_presence_of(:context) }
it 'requires non-empty of context' do
record = described_class.new(context: [])
record.valid?
expect(record).to model_have_error_on_field(:context)
end
it 'requires valid context value' do
record = described_class.new(context: ['invalid'])
record.valid?
expect(record).to model_have_error_on_field(:context)
end
it { is_expected.to_not allow_values([], %w(invalid)).for(:context) }
end
describe 'Normalizations' do