summaryrefslogtreecommitdiffstats
path: root/test/helpers
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2021-07-26 20:55:09 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2021-07-26 20:55:09 +0000
commit0765042d64828b277adc47e3a9120f38ca4e96fe (patch)
treeffce38f1ff7ec4d0b16e22fdb57bd3e251cd1c6a /test/helpers
parent2045128a6f4fd9da7cd23f5af90639486089573c (diff)
downloadredmine-0765042d64828b277adc47e3a9120f38ca4e96fe.tar.gz
redmine-0765042d64828b277adc47e3a9120f38ca4e96fe.zip
Total spent time from issue page should link to global time entries if the issue has subtasks and the subtasks can be on projects that are not descendants of the current project (#35134).
git-svn-id: http://svn.redmine.org/redmine/trunk@21085 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/helpers')
-rw-r--r--test/helpers/issues_helper_test.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/helpers/issues_helper_test.rb b/test/helpers/issues_helper_test.rb
index a46b44b5b..28a520b3e 100644
--- a/test/helpers/issues_helper_test.rb
+++ b/test/helpers/issues_helper_test.rb
@@ -375,4 +375,26 @@ class IssuesHelperTest < Redmine::HelperTest
assert_equal new_project_issue_path(issue.project, params),
url_for_new_subtask(issue)
end
+
+ def test_issue_spent_hours_details_should_link_to_project_time_entries_depending_on_cross_project_setting
+ %w(descendants).each do |setting|
+ with_settings :cross_project_subtasks => setting do
+ TimeEntry.generate!(:issue => Issue.generate!(:parent_issue_id => 1), :hours => 3)
+ TimeEntry.generate!(:issue => Issue.generate!(:parent_issue_id => 1), :hours => 4)
+
+ assert_match "href=\"/projects/ecookbook/time_entries?issue_id=~1\"", issue_spent_hours_details(Issue.find(1))
+ end
+ end
+ end
+
+ def test_issue_spent_hours_details_should_link_to_global_time_entries_depending_on_cross_project_setting
+ %w(system tree hierarchy).each do |setting|
+ with_settings :cross_project_subtasks => setting do
+ TimeEntry.generate!(:issue => Issue.generate!(:parent_issue_id => 1), :hours => 3)
+ TimeEntry.generate!(:issue => Issue.generate!(:parent_issue_id => 1), :hours => 4)
+
+ assert_match "href=\"/time_entries?issue_id=~1\"", issue_spent_hours_details(Issue.find(1))
+ end
+ end
+ end
end