Simplify basic presence validations (#29664)

This commit is contained in:
Matt Jankowski 2024-09-05 11:36:05 -04:00 committed by GitHub
parent bc435c63bd
commit 5acec087ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 28 additions and 159 deletions

View file

@ -6,12 +6,7 @@ RSpec.describe Webhook do
let(:webhook) { Fabricate(:webhook) }
describe 'Validations' do
it 'requires presence of events' do
record = described_class.new(events: nil)
record.valid?
expect(record).to model_have_error_on_field(:events)
end
it { is_expected.to validate_presence_of(:events) }
it 'requires non-empty events value' do
record = described_class.new(events: [])