mirror of
https://github.com/redmine/redmine.git
synced 2026-05-07 15:07:14 +02:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user