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