##// END OF EJS Templates
Rails3: test: scm: mercurial: use "repository_path_hash" for path param...
Toshi MARUYAMA -
r8816:9774782cab72
parent child
Show More
@@ -92,7 +92,7 class RepositoriesMercurialControllerTest < ActionController::TestCase
92 92 @repository.fetch_changesets
93 93 @project.reload
94 94 assert_equal NUM_REV, @repository.changesets.count
95 get :show, :id => PRJ_ID, :path => ['images']
95 get :show, :id => PRJ_ID, :path => repository_path_hash(['images'])[:param]
96 96 assert_response :success
97 97 assert_template 'show'
98 98 assert_not_nil assigns(:entries)
@@ -111,7 +111,8 class RepositoriesMercurialControllerTest < ActionController::TestCase
111 111 @project.reload
112 112 assert_equal NUM_REV, @repository.changesets.count
113 113 [0, '0', '0885933ad4f6'].each do |r1|
114 get :show, :id => PRJ_ID, :path => ['images'], :rev => r1
114 get :show, :id => PRJ_ID, :path => repository_path_hash(['images'])[:param],
115 :rev => r1
115 116 assert_response :success
116 117 assert_template 'show'
117 118 assert_not_nil assigns(:entries)
@@ -127,7 +128,8 class RepositoriesMercurialControllerTest < ActionController::TestCase
127 128 @project.reload
128 129 assert_equal NUM_REV, @repository.changesets.count
129 130 [13, '13', '3a330eb32958'].each do |r1|
130 get :show, :id => PRJ_ID, :path => ['sql_escape', 'percent%dir'],
131 get :show, :id => PRJ_ID,
132 :path => repository_path_hash(['sql_escape', 'percent%dir'])[:param],
131 133 :rev => r1
132 134 assert_response :success
133 135 assert_template 'show'
@@ -148,7 +150,9 class RepositoriesMercurialControllerTest < ActionController::TestCase
148 150 @project.reload
149 151 assert_equal NUM_REV, @repository.changesets.count
150 152 [21, '21', 'adf805632193'].each do |r1|
151 get :show, :id => PRJ_ID, :path => ['latin-1-dir'], :rev => r1
153 get :show, :id => PRJ_ID,
154 :path => repository_path_hash(['latin-1-dir'])[:param],
155 :rev => r1
152 156 assert_response :success
153 157 assert_template 'show'
154 158
@@ -217,14 +221,16 class RepositoriesMercurialControllerTest < ActionController::TestCase
217 221 end
218 222
219 223 def test_changes
220 get :changes, :id => PRJ_ID, :path => ['images', 'edit.png']
224 get :changes, :id => PRJ_ID,
225 :path => repository_path_hash(['images', 'edit.png'])[:param]
221 226 assert_response :success
222 227 assert_template 'changes'
223 228 assert_tag :tag => 'h2', :content => 'edit.png'
224 229 end
225 230
226 231 def test_entry_show
227 get :entry, :id => PRJ_ID, :path => ['sources', 'watchers_controller.rb']
232 get :entry, :id => PRJ_ID,
233 :path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param]
228 234 assert_response :success
229 235 assert_template 'entry'
230 236 # Line 10
@@ -237,7 +243,8 class RepositoriesMercurialControllerTest < ActionController::TestCase
237 243 def test_entry_show_latin_1_path
238 244 [21, '21', 'adf805632193'].each do |r1|
239 245 get :entry, :id => PRJ_ID,
240 :path => ['latin-1-dir', "test-#{@char_1}-2.txt"], :rev => r1
246 :path => repository_path_hash(['latin-1-dir', "test-#{@char_1}-2.txt"])[:param],
247 :rev => r1
241 248 assert_response :success
242 249 assert_template 'entry'
243 250 assert_tag :tag => 'th',
@@ -252,7 +259,8 class RepositoriesMercurialControllerTest < ActionController::TestCase
252 259 with_settings :repositories_encodings => 'UTF-8,ISO-8859-1' do
253 260 [27, '27', '7bbf4c738e71'].each do |r1|
254 261 get :entry, :id => PRJ_ID,
255 :path => ['latin-1-dir', "test-#{@char_1}.txt"], :rev => r1
262 :path => repository_path_hash(['latin-1-dir', "test-#{@char_1}.txt"])[:param],
263 :rev => r1
256 264 assert_response :success
257 265 assert_template 'entry'
258 266 assert_tag :tag => 'th',
@@ -266,20 +274,23 class RepositoriesMercurialControllerTest < ActionController::TestCase
266 274
267 275 def test_entry_download
268 276 get :entry, :id => PRJ_ID,
269 :path => ['sources', 'watchers_controller.rb'], :format => 'raw'
277 :path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param],
278 :format => 'raw'
270 279 assert_response :success
271 280 # File content
272 281 assert @response.body.include?('WITHOUT ANY WARRANTY')
273 282 end
274 283
275 284 def test_entry_binary_force_download
276 get :entry, :id => PRJ_ID, :rev => 1, :path => ['images', 'edit.png']
285 get :entry, :id => PRJ_ID, :rev => 1,
286 :path => repository_path_hash(['images', 'edit.png'])[:param]
277 287 assert_response :success
278 288 assert_equal 'image/png', @response.content_type
279 289 end
280 290
281 291 def test_directory_entry
282 get :entry, :id => PRJ_ID, :path => ['sources']
292 get :entry, :id => PRJ_ID,
293 :path => repository_path_hash(['sources'])[:param]
283 294 assert_response :success
284 295 assert_template 'show'
285 296 assert_not_nil assigns(:entry)
@@ -361,7 +372,8 class RepositoriesMercurialControllerTest < ActionController::TestCase
361 372 end
362 373
363 374 def test_annotate
364 get :annotate, :id => PRJ_ID, :path => ['sources', 'watchers_controller.rb']
375 get :annotate, :id => PRJ_ID,
376 :path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param]
365 377 assert_response :success
366 378 assert_template 'annotate'
367 379 # Line 23, revision 4:def6d2f1254a
@@ -394,9 +406,8 class RepositoriesMercurialControllerTest < ActionController::TestCase
394 406 @repository.fetch_changesets
395 407 @project.reload
396 408 assert_equal NUM_REV, @repository.changesets.count
397
398 409 get :annotate, :id => PRJ_ID,
399 :path => ['sources', 'welcome_controller.rb']
410 :path => repository_path_hash(['sources', 'welcome_controller.rb'])[:param]
400 411 assert_response 404
401 412 assert_error_tag :content => /was not found/
402 413 end
@@ -408,7 +419,7 class RepositoriesMercurialControllerTest < ActionController::TestCase
408 419 assert_equal NUM_REV, @repository.changesets.count
409 420 [2, '400bb8672109', '400', 400].each do |r1|
410 421 get :annotate, :id => PRJ_ID, :rev => r1,
411 :path => ['sources', 'watchers_controller.rb']
422 :path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param]
412 423 assert_response :success
413 424 assert_template 'annotate'
414 425 assert_tag :tag => 'h2', :content => /@ 2:400bb8672109/
@@ -418,7 +429,8 class RepositoriesMercurialControllerTest < ActionController::TestCase
418 429 def test_annotate_latin_1_path
419 430 [21, '21', 'adf805632193'].each do |r1|
420 431 get :annotate, :id => PRJ_ID,
421 :path => ['latin-1-dir', "test-#{@char_1}-2.txt"], :rev => r1
432 :path => repository_path_hash(['latin-1-dir', "test-#{@char_1}-2.txt"])[:param],
433 :rev => r1
422 434 assert_response :success
423 435 assert_template 'annotate'
424 436 assert_tag :tag => 'th',
@@ -452,7 +464,8 class RepositoriesMercurialControllerTest < ActionController::TestCase
452 464 with_settings :repositories_encodings => 'UTF-8,ISO-8859-1' do
453 465 [27, '7bbf4c738e71'].each do |r1|
454 466 get :annotate, :id => PRJ_ID,
455 :path => ['latin-1-dir', "test-#{@char_1}.txt"], :rev => r1
467 :path => repository_path_hash(['latin-1-dir', "test-#{@char_1}.txt"])[:param],
468 :rev => r1
456 469 assert_tag :tag => 'th',
457 470 :content => '1',
458 471 :attributes => { :class => 'line-num' },
General Comments 0
You need to be logged in to leave comments. Login now