summaryrefslogtreecommitdiffstats
path: root/test/functional/issues_controller_test.rb
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2021-11-06 09:11:58 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2021-11-06 09:11:58 +0000
commite9b94a19de65c6548d9f97e82f957d7eaf1729d5 (patch)
tree951df015491aa66c1491f0d1f32df004fa9fc251 /test/functional/issues_controller_test.rb
parent7b9f5af952ba9396b47408234db2a4a4c860948c (diff)
downloadredmine-e9b94a19de65c6548d9f97e82f957d7eaf1729d5.tar.gz
redmine-e9b94a19de65c6548d9f97e82f957d7eaf1729d5.zip
Adds button to "Create and follow" when adding a subtask from the parent issue. Now the user have the following options:
* Create: redirects the user to the parent task (existing behaviour) * Create and follow: redirects the user to the newly created subtask (new behaviour) * Create and add another: redirects the user to new subtask (existing behaviour). (#29076). git-svn-id: http://svn.redmine.org/redmine/trunk@21269 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/issues_controller_test.rb')
-rw-r--r--test/functional/issues_controller_test.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index d90dcfacc..e0e05c97e 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -3212,6 +3212,11 @@ class IssuesControllerTest < Redmine::ControllerTest
assert_select 'select[name=?]', 'issue[done_ratio]'
assert_select 'input[name=?][value=?]', 'issue[custom_field_values][2]', 'Default string'
assert_select 'input[name=?]', 'issue[watcher_user_ids][]'
+
+ # Assert submit buttons
+ assert_select 'input[type=submit][name=?]', 'commit'
+ assert_select 'input[type=submit][name=?]', 'continue'
+ assert_select 'input[type=submit][name=?]', 'follow', 0
end
# Be sure we don't display inactive IssuePriorities
@@ -3824,6 +3829,25 @@ class IssuesControllerTest < Redmine::ControllerTest
assert_select 'div#trackers_description', 0
end
+ def test_get_new_should_show_create_and_follow_button_when_issue_is_subtask_and_back_urL_is_present
+ @request.session[:user_id] = 2
+ get :new, params: {
+ project_id: 1,
+ issue: {
+ parent_issue_id: 2
+ },
+ back_url: "/issues/2"
+ }
+ assert_response :success
+
+ assert_select 'form#issue-form' do
+ # Assert submit buttons
+ assert_select 'input[type=submit][name=?]', 'commit'
+ assert_select 'input[type=submit][name=?]', 'continue'
+ assert_select 'input[type=submit][name=?]', 'follow'
+ end
+ end
+
def test_update_form_for_new_issue
@request.session[:user_id] = 2
post(