##// END OF EJS Templates
Fixed that links for relations in notifications do not include hostname (#15677)....
Jean-Philippe Lang -
r12140:13756eb3a830
parent child
Show More
@@ -79,7 +79,8 module ApplicationHelper
79 79 subject = truncate(subject, :length => options[:truncate])
80 80 end
81 81 end
82 s = link_to text, issue_path(issue), :class => issue.css_classes, :title => title
82 only_path = options[:only_path].nil? ? true : options[:only_path]
83 s = link_to text, issue_path(issue, :only_path => only_path), :class => issue.css_classes, :title => title
83 84 s << h(": #{subject}") if subject
84 85 s = h("#{issue.project} - ") + s if options[:project]
85 86 s
@@ -334,11 +334,11 module IssuesHelper
334 334 if detail.value && !detail.old_value
335 335 rel_issue = Issue.visible.find_by_id(detail.value)
336 336 value = rel_issue.nil? ? "#{l(:label_issue)} ##{detail.value}" :
337 (no_html ? rel_issue : link_to_issue(rel_issue))
337 (no_html ? rel_issue : link_to_issue(rel_issue, :only_path => options[:only_path]))
338 338 elsif detail.old_value && !detail.value
339 339 rel_issue = Issue.visible.find_by_id(detail.old_value)
340 340 old_value = rel_issue.nil? ? "#{l(:label_issue)} ##{detail.old_value}" :
341 (no_html ? rel_issue : link_to_issue(rel_issue))
341 (no_html ? rel_issue : link_to_issue(rel_issue, :only_path => options[:only_path]))
342 342 end
343 343 label = l(detail.prop_key.to_sym)
344 344 end
@@ -113,6 +113,16 class MailerTest < ActiveSupport::TestCase
113 113 end
114 114 end
115 115
116 def test_issue_edit_should_generate_url_with_hostname_for_relations
117 journal = Journal.new(:journalized => Issue.find(1), :user => User.find(1), :created_on => Time.now)
118 journal.details << JournalDetail.new(:property => 'relation', :prop_key => 'label_relates_to', :value => 2)
119 Mailer.deliver_issue_edit(journal)
120 assert_not_nil last_email
121 assert_select_email do
122 assert_select 'a[href=?]', 'http://mydomain.foo/issues/2', :text => 'Feature request #2'
123 end
124 end
125
116 126 def test_generated_links_with_prefix_and_no_relative_url_root
117 127 Setting.default_language = 'en'
118 128 relative_url_root = Redmine::Utils.relative_url_root
General Comments 0
You need to be logged in to leave comments. Login now