diff options
author | Go MAEDA <maeda@farend.jp> | 2021-11-08 14:22:06 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2021-11-08 14:22:06 +0000 |
commit | 578e367c8c95aaf0ae14ecee038a28c5294c16ac (patch) | |
tree | 117008563ac20f34a0a4eaa74d6c8991ea6668e3 /test/functional/issues_controller_test.rb | |
parent | 68fce8e97d1634f9c975dd4fabbd746a8dcd02c0 (diff) | |
download | redmine-578e367c8c95aaf0ae14ecee038a28c5294c16ac.tar.gz redmine-578e367c8c95aaf0ae14ecee038a28c5294c16ac.zip |
Allow addition/removal of subtasks to show in parent's history (#6033).
Patch by Yuichi HARADA.
git-svn-id: http://svn.redmine.org/redmine/trunk@21273 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/issues_controller_test.rb')
-rw-r--r-- | test/functional/issues_controller_test.rb | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index f9432d311..434775e59 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -2344,7 +2344,7 @@ class IssuesControllerTest < Redmine::ControllerTest end def test_show_should_list_subtasks - Issue. + issue = Issue. create!( :project_id => 1, :author_id => 1, :tracker_id => 1, :parent_issue_id => 1, :subject => 'Child Issue' @@ -2354,6 +2354,11 @@ class IssuesControllerTest < Redmine::ControllerTest assert_select 'div#issue_tree' do assert_select 'td.subject', :text => /Child Issue/ end + assert_select 'div#tab-content-history' do + assert_select 'div[id=?]', "change-#{Issue.find(1).journals.last.id}" do + assert_select 'ul.details', :text => "Subtask ##{issue.id} added" + end + end end def test_show_should_show_subtasks_stats @@ -8223,6 +8228,31 @@ class IssuesControllerTest < Redmine::ControllerTest assert !(Issue.find_by_id(1) || Issue.find_by_id(2) || Issue.find_by_id(6)) end + def test_destroy_child_issue + parent = Issue.create!(:project_id => 1, :author_id => 1, :tracker_id => 1, :subject => 'Parent Issue') + child = Issue.create!(:project_id => 1, :author_id => 1, :tracker_id => 1, :subject => 'Child Issue', :parent_issue_id => parent.id) + assert child.is_descendant_of?(parent.reload) + + @request.session[:user_id] = 2 + assert_difference 'Issue.count', -1 do + delete :destroy, :params => {:id => child.id} + end + assert_response :found + assert_redirected_to :action => 'index', :project_id => 'ecookbook' + + parent.reload + assert_equal 2, parent.journals.count + + get :show, :params => {:id => parent.id} + assert_response :success + + assert_select 'div#tab-content-history' do + assert_select 'div[id=?]', "change-#{parent.journals.last.id}" do + assert_select 'ul.details', :text => "Subtask deleted (##{child.id})" + end + end + end + def test_destroy_parent_and_child_issues parent = Issue.create!(:project_id => 1, :author_id => 1, :tracker_id => 1, :subject => 'Parent Issue') |