diff test/functional/previews_controller_test.rb @ 1517:dffacf8a6908 redmine-2.5

Update to Redmine SVN revision 13367 on 2.5-stable branch
author Chris Cannam
date Tue, 09 Sep 2014 09:29:00 +0100
parents e248c7af89ec
children
line wrap: on
line diff
--- a/test/functional/previews_controller_test.rb	Tue Sep 09 09:28:31 2014 +0100
+++ b/test/functional/previews_controller_test.rb	Tue Sep 09 09:29:00 2014 +0100
@@ -32,7 +32,7 @@
     @request.session[:user_id] = 2
     post :issue, :project_id => '1', :issue => {:description => 'Foo'}
     assert_response :success
-    assert_template 'preview'
+    assert_template 'previews/issue'
     assert_not_nil assigns(:description)
   end
 
@@ -41,7 +41,7 @@
     post :issue, :project_id => '1', :id => 1,
          :issue => {:description => Issue.find(1).description, :notes => 'Foo'}
     assert_response :success
-    assert_template 'preview'
+    assert_template 'previews/issue'
     assert_not_nil assigns(:notes)
   end
 
@@ -49,11 +49,19 @@
     @request.session[:user_id] = 2
     post :issue, :project_id => '1', :id => 1, :notes => 'Foo'
     assert_response :success
-    assert_template 'preview'
+    assert_template 'previews/issue'
     assert_not_nil assigns(:notes)
     assert_tag :p, :content => 'Foo'
   end
 
+  def test_preview_issue_notes_should_support_links_to_existing_attachments
+    Attachment.generate!(:container => Issue.find(1), :filename => 'foo.bar')
+    @request.session[:user_id] = 2
+    post :issue, :project_id => '1', :id => 1, :notes => 'attachment:foo.bar'
+    assert_response :success
+    assert_select 'a.attachment', :text => 'foo.bar'
+  end
+
   def test_preview_new_news
     get :news, :project_id => 1,
                   :news => {:title => '',