diff options
author | Go MAEDA <maeda@farend.jp> | 2020-12-10 15:18:49 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2020-12-10 15:18:49 +0000 |
commit | f8bf009cd61ef78da92732390cc1def5c7b4c18b (patch) | |
tree | 0620ab3038ca237bd2f7a9a69ee1ac68f3426714 /test/functional/context_menus_controller_test.rb | |
parent | 0cc5b52ac5536ab21a7683082223f1a1c5638a0b (diff) | |
download | redmine-f8bf009cd61ef78da92732390cc1def5c7b4c18b.tar.gz redmine-f8bf009cd61ef78da92732390cc1def5c7b4c18b.zip |
Allow to add subtask from context menu (#34303).
Patch by Go MAEDA and Takenori TAKAKI.
git-svn-id: http://svn.redmine.org/redmine/trunk@20617 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, 39 insertions, 0 deletions
diff --git a/test/functional/context_menus_controller_test.rb b/test/functional/context_menus_controller_test.rb index 5309e7ba6..b1a819422 100644 --- a/test/functional/context_menus_controller_test.rb +++ b/test/functional/context_menus_controller_test.rb @@ -290,6 +290,45 @@ class ContextMenusControllerTest < Redmine::ControllerTest assert_select 'a', :text => 'eCookbook - Shared' end + def test_context_menu_should_include_add_subtask_link + @request.session[:user_id] = 2 + get( + :issues, + :params => { + :ids => [1] + } + ) + assert_response :success + + assert_select 'a.icon-add[href=?]', '/projects/ecookbook/issues/new?issue%5Bparent_issue_id%5D=1&issue%5Btracker_id%5D=1', :text => 'Add subtask' + end + + def test_context_menu_with_closed_issue_should_not_include_add_subtask_link + @request.session[:user_id] = 2 + get( + :issues, + :params => { + :ids => [8] + } + ) + assert_response :success + + assert_select 'a.icon-add', :text => 'Add subtask', :count => 0 + end + + def test_context_menu_multiple_issues_should_not_include_add_subtask_link + @request.session[:user_id] = 2 + get( + :issues, + :params => { + :ids => [1, 2] + } + ) + assert_response :success + + assert_select 'a.icon-add', :text => 'Add subtask', :count => 0 + end + def test_context_menu_with_issue_that_is_not_visible_should_fail get( :issues, |