##// END OF EJS Templates
attachment: add a functional test to show an ISO-8859-1 content file (#2371)...
Toshi MARUYAMA -
r7748:c1ed67c74178
parent child
Show More
@@ -135,6 +135,26 class AttachmentsControllerTest < ActionController::TestCase
135 end
135 end
136 end
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 def test_show_text_file_should_send_if_too_big
158 def test_show_text_file_should_send_if_too_big
139 Setting.file_max_size_displayed = 512
159 Setting.file_max_size_displayed = 512
140 Attachment.find(4).update_attribute :filesize, 754.kilobyte
160 Attachment.find(4).update_attribute :filesize, 754.kilobyte
General Comments 0
You need to be logged in to leave comments. Login now