summaryrefslogtreecommitdiffstats
path: root/test/unit/project_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/project_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/project_test.rb')
-rw-r--r--test/unit/project_test.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb
index 5fc3743d5..5198d040a 100644
--- a/test/unit/project_test.rb
+++ b/test/unit/project_test.rb
@@ -237,9 +237,9 @@ class ProjectTest < ActiveSupport::TestCase
# make sure that the project non longer exists
assert_raise(ActiveRecord::RecordNotFound) {Project.find(@ecookbook.id)}
# make sure related data was removed
- assert_nil Member.where(:project_id => @ecookbook.id).first
- assert_nil Board.where(:project_id => @ecookbook.id).first
- assert_nil Issue.where(:project_id => @ecookbook.id).first
+ assert_not Member.where(:project_id => @ecookbook.id).exists?
+ assert_not Board.where(:project_id => @ecookbook.id).exists?
+ assert_not Issue.where(:project_id => @ecookbook.id).exists?
end
def test_destroy_should_destroy_subtasks