summaryrefslogtreecommitdiffstats
path: root/test/functional/attachments_controller_test.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-09-19 03:02:03 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-09-19 03:02:03 +0000
commit551c024b454d5a288b976fa5f2de39e303ddead2 (patch)
tree320db9ac9263df7f6aada5505133b528d662cd98 /test/functional/attachments_controller_test.rb
parentf18edc4e1c045b968cba8d8f905257e63a1c0d5c (diff)
downloadredmine-551c024b454d5a288b976fa5f2de39e303ddead2.tar.gz
redmine-551c024b454d5a288b976fa5f2de39e303ddead2.zip
add functional attachment test of mercurial export file (#11868)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10429 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/attachments_controller_test.rb')
-rw-r--r--test/functional/attachments_controller_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/functional/attachments_controller_test.rb b/test/functional/attachments_controller_test.rb
index 11c3faa95..bc37c3181 100644
--- a/test/functional/attachments_controller_test.rb
+++ b/test/functional/attachments_controller_test.rb
@@ -110,6 +110,21 @@ class AttachmentsControllerTest < ActionController::TestCase
assert_equal "sbs", user.pref[:diff_type]
end
+ def test_diff_show_filename_in_mercurial_export
+ set_tmp_attachments_directory
+ a = Attachment.new(:container => Issue.find(1),
+ :file => uploaded_test_file("hg-export.diff", "text/plain"),
+ :author => User.find(1))
+ assert a.save
+ assert_equal 'hg-export.diff', a.filename
+
+ get :show, :id => a.id, :type => 'inline'
+ assert_response :success
+ assert_template 'diff'
+ assert_equal 'text/html', @response.content_type
+ assert_select 'th.filename', :text => 'test1.txt'
+ end
+
def test_show_text_file
get :show, :id => 4
assert_response :success