about summary refs log tree commit diff
path: root/spec/support/matchers/model
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/matchers/model')
-rw-r--r--spec/support/matchers/model/model_have_error_on_field.rb4
1 files changed, 1 insertions, 3 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..d85db2fca 100644
--- a/spec/support/matchers/model/model_have_error_on_field.rb
+++ b/spec/support/matchers/model/model_have_error_on_field.rb
@@ -1,8 +1,6 @@
 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)
   end