summaryrefslogtreecommitdiffstats
path: root/test/functional/workflows_controller_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/functional/workflows_controller_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/functional/workflows_controller_test.rb')
-rw-r--r--test/functional/workflows_controller_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/functional/workflows_controller_test.rb b/test/functional/workflows_controller_test.rb
index cf9ab2eae..cc535c42d 100644
--- a/test/functional/workflows_controller_test.rb
+++ b/test/functional/workflows_controller_test.rb
@@ -145,8 +145,8 @@ class WorkflowsControllerTest < Redmine::ControllerTest
assert_response 302
assert_equal 3, WorkflowTransition.where(:tracker_id => 1, :role_id => 2).count
- assert_not_nil WorkflowTransition.where(:role_id => 2, :tracker_id => 1, :old_status_id => 3, :new_status_id => 2).first
- assert_nil WorkflowTransition.where(:role_id => 2, :tracker_id => 1, :old_status_id => 5, :new_status_id => 4).first
+ assert WorkflowTransition.where(:role_id => 2, :tracker_id => 1, :old_status_id => 3, :new_status_id => 2).exists?
+ assert_not WorkflowTransition.where(:role_id => 2, :tracker_id => 1, :old_status_id => 5, :new_status_id => 4).exists?
end
def test_post_edit_with_allowed_statuses_for_new_issues