##// END OF EJS Templates
Rails3: test: scm: git: use "repository_path_hash" for path param...
Toshi MARUYAMA -
r8804:08811bd259b0
parent child
Show More
@@ -134,7 +134,7 class RepositoriesGitControllerTest < ActionController::TestCase
134 @repository.fetch_changesets
134 @repository.fetch_changesets
135 @project.reload
135 @project.reload
136 assert_equal NUM_REV, @repository.changesets.count
136 assert_equal NUM_REV, @repository.changesets.count
137 get :show, :id => PRJ_ID, :path => ['images']
137 get :show, :id => PRJ_ID, :path => repository_path_hash(['images'])[:param]
138 assert_response :success
138 assert_response :success
139 assert_template 'show'
139 assert_template 'show'
140 assert_not_nil assigns(:entries)
140 assert_not_nil assigns(:entries)
@@ -152,7 +152,7 class RepositoriesGitControllerTest < ActionController::TestCase
152 @repository.fetch_changesets
152 @repository.fetch_changesets
153 @project.reload
153 @project.reload
154 assert_equal NUM_REV, @repository.changesets.count
154 assert_equal NUM_REV, @repository.changesets.count
155 get :show, :id => PRJ_ID, :path => ['images'],
155 get :show, :id => PRJ_ID, :path => repository_path_hash(['images'])[:param],
156 :rev => '7234cb2750b63f47bff735edc50a1c0a433c2518'
156 :rev => '7234cb2750b63f47bff735edc50a1c0a433c2518'
157 assert_response :success
157 assert_response :success
158 assert_template 'show'
158 assert_template 'show'
@@ -163,14 +163,16 class RepositoriesGitControllerTest < ActionController::TestCase
163 end
163 end
164
164
165 def test_changes
165 def test_changes
166 get :changes, :id => PRJ_ID, :path => ['images', 'edit.png']
166 get :changes, :id => PRJ_ID,
167 :path => repository_path_hash(['images', 'edit.png'])[:param]
167 assert_response :success
168 assert_response :success
168 assert_template 'changes'
169 assert_template 'changes'
169 assert_tag :tag => 'h2', :content => 'edit.png'
170 assert_tag :tag => 'h2', :content => 'edit.png'
170 end
171 end
171
172
172 def test_entry_show
173 def test_entry_show
173 get :entry, :id => PRJ_ID, :path => ['sources', 'watchers_controller.rb']
174 get :entry, :id => PRJ_ID,
175 :path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param]
174 assert_response :success
176 assert_response :success
175 assert_template 'entry'
177 assert_template 'entry'
176 # Line 19
178 # Line 19
@@ -189,7 +191,8 class RepositoriesGitControllerTest < ActionController::TestCase
189 with_settings :repositories_encodings => 'UTF-8,ISO-8859-1' do
191 with_settings :repositories_encodings => 'UTF-8,ISO-8859-1' do
190 ['57ca437c', '57ca437c0acbbcb749821fdf3726a1367056d364'].each do |r1|
192 ['57ca437c', '57ca437c0acbbcb749821fdf3726a1367056d364'].each do |r1|
191 get :entry, :id => PRJ_ID,
193 get :entry, :id => PRJ_ID,
192 :path => ['latin-1-dir', "test-#{@char_1}.txt"], :rev => r1
194 :path => repository_path_hash(['latin-1-dir', "test-#{@char_1}.txt"])[:param],
195 :rev => r1
193 assert_response :success
196 assert_response :success
194 assert_template 'entry'
197 assert_template 'entry'
195 assert_tag :tag => 'th',
198 assert_tag :tag => 'th',
@@ -203,7 +206,8 class RepositoriesGitControllerTest < ActionController::TestCase
203 end
206 end
204
207
205 def test_entry_download
208 def test_entry_download
206 get :entry, :id => PRJ_ID, :path => ['sources', 'watchers_controller.rb'],
209 get :entry, :id => PRJ_ID,
210 :path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param],
207 :format => 'raw'
211 :format => 'raw'
208 assert_response :success
212 assert_response :success
209 # File content
213 # File content
@@ -211,7 +215,8 class RepositoriesGitControllerTest < ActionController::TestCase
211 end
215 end
212
216
213 def test_directory_entry
217 def test_directory_entry
214 get :entry, :id => PRJ_ID, :path => ['sources']
218 get :entry, :id => PRJ_ID,
219 :path => repository_path_hash(['sources'])[:param]
215 assert_response :success
220 assert_response :success
216 assert_template 'show'
221 assert_template 'show'
217 assert_not_nil assigns(:entry)
222 assert_not_nil assigns(:entry)
@@ -334,7 +339,8 class RepositoriesGitControllerTest < ActionController::TestCase
334 end
339 end
335
340
336 def test_annotate
341 def test_annotate
337 get :annotate, :id => PRJ_ID, :path => ['sources', 'watchers_controller.rb']
342 get :annotate, :id => PRJ_ID,
343 :path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param]
338 assert_response :success
344 assert_response :success
339 assert_template 'annotate'
345 assert_template 'annotate'
340 # Line 24, changeset 2f9c0091
346 # Line 24, changeset 2f9c0091
@@ -366,14 +372,15 class RepositoriesGitControllerTest < ActionController::TestCase
366 @project.reload
372 @project.reload
367 assert_equal NUM_REV, @repository.changesets.count
373 assert_equal NUM_REV, @repository.changesets.count
368 get :annotate, :id => PRJ_ID, :rev => 'deff7',
374 get :annotate, :id => PRJ_ID, :rev => 'deff7',
369 :path => ['sources', 'watchers_controller.rb']
375 :path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param]
370 assert_response :success
376 assert_response :success
371 assert_template 'annotate'
377 assert_template 'annotate'
372 assert_tag :tag => 'h2', :content => /@ deff712f/
378 assert_tag :tag => 'h2', :content => /@ deff712f/
373 end
379 end
374
380
375 def test_annotate_binary_file
381 def test_annotate_binary_file
376 get :annotate, :id => PRJ_ID, :path => ['images', 'edit.png']
382 get :annotate, :id => PRJ_ID,
383 :path => repository_path_hash(['images', 'edit.png'])[:param]
377 assert_response 500
384 assert_response 500
378 assert_tag :tag => 'p', :attributes => { :id => /errorExplanation/ },
385 assert_tag :tag => 'p', :attributes => { :id => /errorExplanation/ },
379 :content => /cannot be annotated/
386 :content => /cannot be annotated/
@@ -381,12 +388,16 class RepositoriesGitControllerTest < ActionController::TestCase
381
388
382 def test_annotate_error_when_too_big
389 def test_annotate_error_when_too_big
383 with_settings :file_max_size_displayed => 1 do
390 with_settings :file_max_size_displayed => 1 do
384 get :annotate, :id => PRJ_ID, :path => ['sources', 'watchers_controller.rb'], :rev => 'deff712f'
391 get :annotate, :id => PRJ_ID,
392 :path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param],
393 :rev => 'deff712f'
385 assert_response 500
394 assert_response 500
386 assert_tag :tag => 'p', :attributes => { :id => /errorExplanation/ },
395 assert_tag :tag => 'p', :attributes => { :id => /errorExplanation/ },
387 :content => /exceeds the maximum text file size/
396 :content => /exceeds the maximum text file size/
388
397
389 get :annotate, :id => PRJ_ID, :path => ['README'], :rev => '7234cb2'
398 get :annotate, :id => PRJ_ID,
399 :path => repository_path_hash(['README'])[:param],
400 :rev => '7234cb2'
390 assert_response :success
401 assert_response :success
391 assert_template 'annotate'
402 assert_template 'annotate'
392 end
403 end
@@ -401,7 +412,8 class RepositoriesGitControllerTest < ActionController::TestCase
401 with_settings :repositories_encodings => 'UTF-8,ISO-8859-1' do
412 with_settings :repositories_encodings => 'UTF-8,ISO-8859-1' do
402 ['57ca437c', '57ca437c0acbbcb749821fdf3726a1367056d364'].each do |r1|
413 ['57ca437c', '57ca437c0acbbcb749821fdf3726a1367056d364'].each do |r1|
403 get :annotate, :id => PRJ_ID,
414 get :annotate, :id => PRJ_ID,
404 :path => ['latin-1-dir', "test-#{@char_1}.txt"], :rev => r1
415 :path => repository_path_hash(['latin-1-dir', "test-#{@char_1}.txt"])[:param],
416 :rev => r1
405 assert_tag :tag => 'th',
417 assert_tag :tag => 'th',
406 :content => '1',
418 :content => '1',
407 :attributes => { :class => 'line-num' },
419 :attributes => { :class => 'line-num' },
General Comments 0
You need to be logged in to leave comments. Login now