about summary refs log tree commit diff
path: root/spec/support/matchers/model/model_have_error_on_field.rb
diff options
context:
space:
mode:
authorNick Schonning <nschonni@gmail.com>2023-02-18 06:37:47 -0500
committerGitHub <noreply@github.com>2023-02-18 12:37:47 +0100
commite2a3ebb271017d800a448ad3ef3e8324ac1fab3b (patch)
treeed802f97caaed335d925ea271b244fac029aed5c /spec/support/matchers/model/model_have_error_on_field.rb
parent9ab2a775c9a832fe6320f95e5b405feb93f9eaf3 (diff)
Autofix Rubocop Style/IfUnlessModifier (#23697)
Diffstat (limited to 'spec/support/matchers/model/model_have_error_on_field.rb')
-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