diff --git a/spec/models/form/import_spec.rb b/spec/models/form/import_spec.rb index e14ad6eca0..dd8fd35a05 100644 --- a/spec/models/form/import_spec.rb +++ b/spec/models/form/import_spec.rb @@ -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 diff --git a/spec/support/matchers/model/model_have_error_on_field.rb b/spec/support/matchers/model/model_have_error_on_field.rb deleted file mode 100644 index 0f9c81a475..0000000000 --- a/spec/support/matchers/model/model_have_error_on_field.rb +++ /dev/null @@ -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