diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2021-07-26 21:46:43 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2021-07-26 21:46:43 +0000 |
commit | 753477530608b0f5347cfd8ac9e348e6be4f4950 (patch) | |
tree | 5391eca93dc8e9d6d52c819b2e2e9cd195e96391 /test/functional/context_menus_controller_test.rb | |
parent | 05452a7b9a6c528daeec1d3549d20bcd83943b1d (diff) | |
download | redmine-753477530608b0f5347cfd8ac9e348e6be4f4950.tar.gz redmine-753477530608b0f5347cfd8ac9e348e6be4f4950.zip |
Use issue path instead of bulk update issues path when only one issue is selected in the context menu (#33521).
git-svn-id: http://svn.redmine.org/redmine/trunk@21089 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/context_menus_controller_test.rb')
-rw-r--r-- | test/functional/context_menus_controller_test.rb | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/test/functional/context_menus_controller_test.rb b/test/functional/context_menus_controller_test.rb index 5178ca61b..4b3b4aaca 100644 --- a/test/functional/context_menus_controller_test.rb +++ b/test/functional/context_menus_controller_test.rb @@ -36,7 +36,7 @@ class ContextMenusControllerTest < Redmine::ControllerTest :time_entries, :custom_fields, :custom_fields_trackers, :custom_fields_projects - def test_context_menu_one_issue + def test_context_menu_one_issue_should_link_to_issue_path @request.session[:user_id] = 2 get( :issues, @@ -52,15 +52,38 @@ class ContextMenusControllerTest < Redmine::ControllerTest assert_select 'a.icon-del[href=?]', '/issues?ids%5B%5D=1', :text => 'Delete' # Statuses - assert_select 'a[href=?]', '/issues/bulk_update?ids%5B%5D=1&issue%5Bstatus_id%5D=5', :text => 'Closed' - assert_select 'a[href=?]', '/issues/bulk_update?ids%5B%5D=1&issue%5Bpriority_id%5D=8', :text => 'Immediate' + assert_select 'a[href=?]', '/issues/1?ids%5B%5D=1&issue%5Bstatus_id%5D=5', :text => 'Closed' + assert_select 'a[href=?]', '/issues/1?ids%5B%5D=1&issue%5Bpriority_id%5D=8', :text => 'Immediate' # No inactive priorities assert_select 'a', :text => /Inactive Priority/, :count => 0 # Versions - assert_select 'a[href=?]', '/issues/bulk_update?ids%5B%5D=1&issue%5Bfixed_version_id%5D=3', :text => '2.0' - assert_select 'a[href=?]', '/issues/bulk_update?ids%5B%5D=1&issue%5Bfixed_version_id%5D=4', :text => 'eCookbook Subproject 1 - 2.0' + assert_select 'a[href=?]', '/issues/1?ids%5B%5D=1&issue%5Bfixed_version_id%5D=3', :text => '2.0' + assert_select 'a[href=?]', '/issues/1?ids%5B%5D=1&issue%5Bfixed_version_id%5D=4', :text => 'eCookbook Subproject 1 - 2.0' # Assignees - assert_select 'a[href=?]', '/issues/bulk_update?ids%5B%5D=1&issue%5Bassigned_to_id%5D=3', :text => 'Dave Lopper' + assert_select 'a[href=?]', '/issues/1?ids%5B%5D=1&issue%5Bassigned_to_id%5D=3', :text => 'Dave Lopper' + end + + def test_context_menu_multiple_issues_should_link_to_bulk_update_issues_path + @request.session[:user_id] = 2 + get :issues, :params => { + :ids => [1, 2] + } + assert_response :success + + assert_select 'a.icon-edit[href=?]', '/issues/bulk_edit?ids%5B%5D=1&ids%5B%5D=2', :text => 'Edit' + assert_select 'a.icon-copy[href=?]', '/issues/bulk_edit?copy=1&ids%5B%5D=1&ids%5B%5D=2', :text => 'Copy' + assert_select 'a.icon-del[href=?]', '/issues?ids%5B%5D=1&ids%5B%5D=2', :text => 'Delete' + + # Statuses + assert_select 'a[href=?]', '/issues/bulk_update?ids%5B%5D=1&ids%5B%5D=2&issue%5Bstatus_id%5D=5', :text => 'Closed' + assert_select 'a[href=?]', '/issues/bulk_update?ids%5B%5D=1&ids%5B%5D=2&issue%5Bpriority_id%5D=8', :text => 'Immediate' + # No inactive priorities + assert_select 'a', :text => /Inactive Priority/, :count => 0 + # Versions + assert_select 'a[href=?]', '/issues/bulk_update?ids%5B%5D=1&ids%5B%5D=2&issue%5Bfixed_version_id%5D=3', :text => '2.0' + assert_select 'a[href=?]', '/issues/bulk_update?ids%5B%5D=1&ids%5B%5D=2&issue%5Bfixed_version_id%5D=4', :text => 'eCookbook Subproject 1 - 2.0' + # Assignees + assert_select 'a[href=?]', '/issues/bulk_update?ids%5B%5D=1&ids%5B%5D=2&issue%5Bassigned_to_id%5D=3', :text => 'Dave Lopper' end def test_context_menu_one_issue_by_anonymous @@ -272,12 +295,12 @@ class ContextMenusControllerTest < Redmine::ControllerTest get( :issues, :params => { - :ids => [1] + :ids => [1, 2] } ) assert_response :success - assert_select 'a[href=?]', '/issues/bulk_update?ids%5B%5D=1&issue%5Bassigned_to_id%5D=2', :text => / me / + assert_select 'a[href=?]', '/issues/bulk_update?ids%5B%5D=1&ids%5B%5D=2&issue%5Bassigned_to_id%5D=2', :text => / me / end def test_context_menu_should_propose_shared_versions_for_issues_from_different_projects |