@@ -135,6 +135,26 class AttachmentsControllerTest < ActionController::TestCase | |||
|
135 | 135 | end |
|
136 | 136 | end |
|
137 | 137 | |
|
138 | def test_show_text_file_latin_1 | |
|
139 | set_tmp_attachments_directory | |
|
140 | with_settings :repositories_encodings => 'UTF-8,ISO-8859-1' do | |
|
141 | a = Attachment.new(:container => Issue.find(1), | |
|
142 | :file => uploaded_test_file("iso8859-1.txt", "text/plain"), | |
|
143 | :author => User.find(1)) | |
|
144 | assert a.save | |
|
145 | assert_equal 'iso8859-1.txt', a.filename | |
|
146 | ||
|
147 | get :show, :id => a.id | |
|
148 | assert_response :success | |
|
149 | assert_template 'file' | |
|
150 | assert_equal 'text/html', @response.content_type | |
|
151 | assert_tag :tag => 'th', | |
|
152 | :content => '7', | |
|
153 | :attributes => { :class => 'line-num' }, | |
|
154 | :sibling => { :tag => 'td', :content => /Demande créée avec succès/ } | |
|
155 | end | |
|
156 | end | |
|
157 | ||
|
138 | 158 | def test_show_text_file_should_send_if_too_big |
|
139 | 159 | Setting.file_max_size_displayed = 512 |
|
140 | 160 | Attachment.find(4).update_attribute :filesize, 754.kilobyte |
General Comments 0
You need to be logged in to leave comments.
Login now