mirror of
https://github.com/redmine/redmine.git
synced 2026-05-07 12:17:28 +02:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user