@@ -847,7 +847,8 module ApplicationHelper | |||
|
847 | 847 | repo_prefix = nil |
|
848 | 848 | end |
|
849 | 849 | when 'attachment' |
|
850 |
attachments = options[:attachments] || |
|
|
850 | attachments = options[:attachments] || [] | |
|
851 | attachments += obj.attachments if obj.respond_to?(:attachments) | |
|
851 | 852 | if attachments && attachment = Attachment.latest_attach(attachments, name) |
|
852 | 853 | link = link_to_attachment(attachment, :only_path => only_path, :download => true, :class => 'attachment') |
|
853 | 854 | end |
@@ -54,6 +54,14 class PreviewsControllerTest < ActionController::TestCase | |||
|
54 | 54 | assert_tag :p, :content => 'Foo' |
|
55 | 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 | 65 | def test_preview_new_news |
|
58 | 66 | get :news, :project_id => 1, |
|
59 | 67 | :news => {:title => '', |
General Comments 0
You need to be logged in to leave comments.
Login now