##// END OF EJS Templates
add functional attachment test of mercurial export file (#11868)...
Toshi MARUYAMA -
r10246:551c024b454d
parent child
Show More
@@ -0,0 +1,13
1 # HG changeset patch
2 # User test
3 # Date 1348014182 -32400
4 # Node ID d1c871b8ef113df7f1c56d41e6e3bfbaff976e1f
5 # Parent 180b6605936cdc7909c5f08b59746ec1a7c99b3e
6 modify test1.txt
7
8 diff -r 180b6605936c -r d1c871b8ef11 test1.txt
9 --- a/test1.txt
10 +++ b/test1.txt
11 @@ -1,1 +1,1 @@
12 -test1
13 +modify test1
@@ -110,6 +110,21 class AttachmentsControllerTest < ActionController::TestCase
110 assert_equal "sbs", user.pref[:diff_type]
110 assert_equal "sbs", user.pref[:diff_type]
111 end
111 end
112
112
113 def test_diff_show_filename_in_mercurial_export
114 set_tmp_attachments_directory
115 a = Attachment.new(:container => Issue.find(1),
116 :file => uploaded_test_file("hg-export.diff", "text/plain"),
117 :author => User.find(1))
118 assert a.save
119 assert_equal 'hg-export.diff', a.filename
120
121 get :show, :id => a.id, :type => 'inline'
122 assert_response :success
123 assert_template 'diff'
124 assert_equal 'text/html', @response.content_type
125 assert_select 'th.filename', :text => 'test1.txt'
126 end
127
113 def test_show_text_file
128 def test_show_text_file
114 get :show, :id => 4
129 get :show, :id => 4
115 assert_response :success
130 assert_response :success
General Comments 0
You need to be logged in to leave comments. Login now