summaryrefslogtreecommitdiffstats
path: root/test/unit/enumeration_test.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2020-05-03 00:44:08 +0000
committerGo MAEDA <maeda@farend.jp>2020-05-03 00:44:08 +0000
commite9e0c538da70361ebfbe4f1a21f1818724512943 (patch)
treef69b678914977addf58537689a61c0e3e37c0164 /test/unit/enumeration_test.rb
parent16789259ccde7a9a42d82e2b803f0d8d097f2777 (diff)
downloadredmine-e9e0c538da70361ebfbe4f1a21f1818724512943.tar.gz
redmine-e9e0c538da70361ebfbe4f1a21f1818724512943.zip
Use more efficient "exists?" instead of "first" in tests when checking the existence of rows (#33367).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@19746 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/enumeration_test.rb')
-rw-r--r--test/unit/enumeration_test.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/unit/enumeration_test.rb b/test/unit/enumeration_test.rb
index 5c897f311..247a3c4c5 100644
--- a/test/unit/enumeration_test.rb
+++ b/test/unit/enumeration_test.rb
@@ -92,7 +92,7 @@ class EnumerationTest < ActiveSupport::TestCase
def test_destroy_with_reassign
Enumeration.find(4).destroy(Enumeration.find(6))
- assert_nil Issue.where(:priority_id => 4).first
+ assert_not Issue.where(:priority_id => 4).exists?
assert_equal 6, Enumeration.find(6).objects_count
end