diff options
Diffstat (limited to 'spec/support/matchers/model')
-rw-r--r-- | spec/support/matchers/model/model_have_error_on_field.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/support/matchers/model/model_have_error_on_field.rb b/spec/support/matchers/model/model_have_error_on_field.rb index 85bdd8215..0f9c81a47 100644 --- a/spec/support/matchers/model/model_have_error_on_field.rb +++ b/spec/support/matchers/model/model_have_error_on_field.rb @@ -1,10 +1,10 @@ +# frozen_string_literal: true + RSpec::Matchers.define :model_have_error_on_field do |expected| match do |record| - if record.errors.empty? - record.valid? - end + record.valid? if record.errors.empty? - record.errors.has_key?(expected) + record.errors.key?(expected) end failure_message do |record| |