##// END OF EJS Templates
Fixed that magic links to existing attachments are not converted when previewing issue notes....
Jean-Philippe Lang -
r12201:58a63c49c49b
parent child
Show More
@@ -847,7 +847,8 module ApplicationHelper
847 repo_prefix = nil
847 repo_prefix = nil
848 end
848 end
849 when 'attachment'
849 when 'attachment'
850 attachments = options[:attachments] || (obj && obj.respond_to?(:attachments) ? obj.attachments : nil)
850 attachments = options[:attachments] || []
851 attachments += obj.attachments if obj.respond_to?(:attachments)
851 if attachments && attachment = Attachment.latest_attach(attachments, name)
852 if attachments && attachment = Attachment.latest_attach(attachments, name)
852 link = link_to_attachment(attachment, :only_path => only_path, :download => true, :class => 'attachment')
853 link = link_to_attachment(attachment, :only_path => only_path, :download => true, :class => 'attachment')
853 end
854 end
@@ -54,6 +54,14 class PreviewsControllerTest < ActionController::TestCase
54 assert_tag :p, :content => 'Foo'
54 assert_tag :p, :content => 'Foo'
55 end
55 end
56
56
57 def test_preview_issue_notes_should_support_links_to_existing_attachments
58 Attachment.generate!(:container => Issue.find(1), :filename => 'foo.bar')
59 @request.session[:user_id] = 2
60 post :issue, :project_id => '1', :id => 1, :notes => 'attachment:foo.bar'
61 assert_response :success
62 assert_select 'a.attachment', :text => 'foo.bar'
63 end
64
57 def test_preview_new_news
65 def test_preview_new_news
58 get :news, :project_id => 1,
66 get :news, :project_id => 1,
59 :news => {:title => '',
67 :news => {:title => '',
General Comments 0
You need to be logged in to leave comments. Login now