summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/helpers/application_helper.rb2
-rw-r--r--test/fixtures/changesets.yml12
-rw-r--r--test/functional/issues_controller_test.rb16
3 files changed, 29 insertions, 1 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 2cc704be8..7835bf235 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -436,7 +436,7 @@ module ApplicationHelper
def format_changeset_comments(changeset, options={})
method = options[:short] ? :short_comments : :comments
- textilizable changeset, method, :formatting => Setting.commit_logs_formatting?
+ textilizable changeset, method, project: changeset.project, formatting: Setting.commit_logs_formatting?
end
def due_date_distance_in_words(date)
diff --git a/test/fixtures/changesets.yml b/test/fixtures/changesets.yml
index 247dda375..8eaca6788 100644
--- a/test/fixtures/changesets.yml
+++ b/test/fixtures/changesets.yml
@@ -102,3 +102,15 @@ changesets_010:
user_id: 3
repository_id: 10
committer: dlopper
+changesets_011:
+ commit_date: "2025-04-07"
+ comments: |-
+ This commit references an issue and a [[wiki]] page
+ Refs #2
+ committed_on: 2025-04-07 19:00:00
+ revision: "11"
+ id: 110
+ scmid:
+ user_id: 3
+ repository_id: 10
+ committer: dlopper
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 5af5b2797..a6aff636f 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -3265,6 +3265,22 @@ class IssuesControllerTest < Redmine::ControllerTest
end
end
+ def test_show_render_changeset_comments_in_original_context
+ issue = Issue.find(9)
+ issue.changeset_ids = [110]
+ issue.save!
+
+ @request.session[:user_id] = 2
+ get :issue_tab, params: {id: issue.id, name: 'changesets', format: 'js'}, xhr: true
+
+ assert_select 'div#changeset-110' do
+ # assert_select 'div.tabs a[id=?]', 'tab-changesets', text: 'unicorns'
+ assert_select 'div.changeset-comments' do
+ assert_select 'a[href=?]', '/projects/ecookbook/wiki/Wiki', text: 'wiki'
+ end
+ end
+ end
+
def test_show_should_display_spent_time_tab_for_issue_with_time_entries
@request.session[:user_id] = 1
get :show, :params => {:id => 3}