Remove unused model_have_error_on_field matcher (#33273)

This commit is contained in:
Matt Jankowski 2024-12-12 05:28:05 -05:00 committed by GitHub
parent e0a49af47d
commit 4bf6af3b61
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1 additions and 19 deletions

View file

@ -61,10 +61,7 @@ RSpec.describe Form::Import do
let(:import_type) { 'following' }
let(:import_file) { 'boop.ogg' }
it 'has errors' do
# NOTE: not testing more specific error because we don't know the string to match
expect(subject).to model_have_error_on_field(:data)
end
it { is_expected.to_not allow_value(data).for(:data) }
end
context 'when importing more follows than allowed' do

View file

@ -1,15 +0,0 @@
# frozen_string_literal: true
RSpec::Matchers.define :model_have_error_on_field do |expected|
match do |record|
record.valid? if record.errors.empty?
record.errors.key?(expected)
end
failure_message do |record|
keys = record.errors.attribute_names
"expect record.errors(#{keys}) to include #{expected}"
end
end