diff test/functional/previews_controller_test.rb @ 1526:404aa68d4227

Merge from live branch
author Chris Cannam
date Thu, 11 Sep 2014 12:46:20 +0100
parents dffacf8a6908
children
line wrap: on
line diff
--- a/test/functional/previews_controller_test.rb	Mon Mar 17 08:57:04 2014 +0000
+++ b/test/functional/previews_controller_test.rb	Thu Sep 11 12:46:20 2014 +0100
@@ -1,5 +1,5 @@
 # Redmine - project management software
-# Copyright (C) 2006-2012  Jean-Philippe Lang
+# Copyright (C) 2006-2014  Jean-Philippe Lang
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
@@ -25,7 +25,6 @@
            :member_roles,
            :members,
            :enabled_modules,
-           :workflows,
            :journals, :journal_details,
            :news
 
@@ -33,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
 
@@ -42,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
 
@@ -50,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 => '',