##// END OF EJS Templates
Merged r10502 from trunk to 1.4-stable (#11966)...
Toshi MARUYAMA -
r10298:8a8df72937c5
parent child
Show More
@@ -1,580 +1,594
1 1 # Redmine - project management software
2 2 # Copyright (C) 2006-2011 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
6 6 # as published by the Free Software Foundation; either version 2
7 7 # of the License, or (at your option) any later version.
8 8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 13 #
14 14 # You should have received a copy of the GNU General Public License
15 15 # along with this program; if not, write to the Free Software
16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 18 require File.expand_path('../../test_helper', __FILE__)
19 19
20 20 class RepositoriesGitControllerTest < ActionController::TestCase
21 21 tests RepositoriesController
22 22
23 23 fixtures :projects, :users, :roles, :members, :member_roles,
24 24 :repositories, :enabled_modules
25 25
26 26 REPOSITORY_PATH = Rails.root.join('tmp/test/git_repository').to_s
27 27 REPOSITORY_PATH.gsub!(/\//, "\\") if Redmine::Platform.mswin?
28 28 PRJ_ID = 3
29 29 CHAR_1_HEX = "\xc3\x9c"
30 30 NUM_REV = 28
31 31
32 32 ## Git, Mercurial and CVS path encodings are binary.
33 33 ## Subversion supports URL encoding for path.
34 34 ## Redmine Mercurial adapter and extension use URL encoding.
35 35 ## Git accepts only binary path in command line parameter.
36 36 ## So, there is no way to use binary command line parameter in JRuby.
37 37 JRUBY_SKIP = (RUBY_PLATFORM == 'java')
38 38 JRUBY_SKIP_STR = "TODO: This test fails in JRuby"
39 39
40 40 def setup
41 41 @ruby19_non_utf8_pass =
42 42 (RUBY_VERSION >= '1.9' && Encoding.default_external.to_s != 'UTF-8')
43 43
44 44 User.current = nil
45 45 @project = Project.find(PRJ_ID)
46 46 @repository = Repository::Git.create(
47 47 :project => @project,
48 48 :url => REPOSITORY_PATH,
49 49 :path_encoding => 'ISO-8859-1'
50 50 )
51 51 assert @repository
52 52 @char_1 = CHAR_1_HEX.dup
53 53 if @char_1.respond_to?(:force_encoding)
54 54 @char_1.force_encoding('UTF-8')
55 55 end
56 56 end
57 57
58 58 def test_create_and_update
59 59 @request.session[:user_id] = 1
60 60 assert_difference 'Repository.count' do
61 61 post :create, :project_id => 'subproject1',
62 62 :repository_scm => 'Git',
63 63 :repository => {
64 64 :url => '/test',
65 65 :is_default => '0',
66 66 :identifier => 'test-create',
67 67 :extra_report_last_commit => '1',
68 68 }
69 69 end
70 70 assert_response 302
71 71 repository = Repository.first(:order => 'id DESC')
72 72 assert_kind_of Repository::Git, repository
73 73 assert_equal '/test', repository.url
74 74 assert_equal true, repository.extra_report_last_commit
75 75
76 76 put :update, :id => repository.id,
77 77 :repository => {
78 78 :extra_report_last_commit => '0',
79 79 :identifier => 'test-update',
80 80 }
81 81 assert_response 302
82 82 repo2 = Repository.find(repository.id)
83 83 assert_equal 'test-update', repo2.identifier
84 84 assert_equal false, repo2.extra_report_last_commit
85 85 end
86 86
87 87 if File.directory?(REPOSITORY_PATH)
88 88 ## Ruby uses ANSI api to fork a process on Windows.
89 89 ## Japanese Shift_JIS and Traditional Chinese Big5 have 0x5c(backslash) problem
90 90 ## and these are incompatible with ASCII.
91 91 ## Git for Windows (msysGit) changed internal API from ANSI to Unicode in 1.7.10
92 92 ## http://code.google.com/p/msysgit/issues/detail?id=80
93 93 ## So, Latin-1 path tests fail on Japanese Windows
94 94 WINDOWS_PASS = (Redmine::Platform.mswin? &&
95 95 Redmine::Scm::Adapters::GitAdapter.client_version_above?([1, 7, 10]))
96 96 WINDOWS_SKIP_STR = "TODO: This test fails in Git for Windows above 1.7.10"
97 97
98 98 def test_get_new
99 99 @request.session[:user_id] = 1
100 100 @project.repository.destroy
101 101 get :new, :project_id => 'subproject1', :repository_scm => 'Git'
102 102 assert_response :success
103 103 assert_template 'new'
104 104 assert_kind_of Repository::Git, assigns(:repository)
105 105 assert assigns(:repository).new_record?
106 106 end
107 107
108 108 def test_browse_root
109 109 assert_equal 0, @repository.changesets.count
110 110 @repository.fetch_changesets
111 111 @project.reload
112 112 assert_equal NUM_REV, @repository.changesets.count
113 113
114 114 get :show, :id => PRJ_ID
115 115 assert_response :success
116 116 assert_template 'show'
117 117 assert_not_nil assigns(:entries)
118 118 assert_equal 9, assigns(:entries).size
119 119 assert assigns(:entries).detect {|e| e.name == 'images' && e.kind == 'dir'}
120 120 assert assigns(:entries).detect {|e| e.name == 'this_is_a_really_long_and_verbose_directory_name' && e.kind == 'dir'}
121 121 assert assigns(:entries).detect {|e| e.name == 'sources' && e.kind == 'dir'}
122 122 assert assigns(:entries).detect {|e| e.name == 'README' && e.kind == 'file'}
123 123 assert assigns(:entries).detect {|e| e.name == 'copied_README' && e.kind == 'file'}
124 124 assert assigns(:entries).detect {|e| e.name == 'new_file.txt' && e.kind == 'file'}
125 125 assert assigns(:entries).detect {|e| e.name == 'renamed_test.txt' && e.kind == 'file'}
126 126 assert assigns(:entries).detect {|e| e.name == 'filemane with spaces.txt' && e.kind == 'file'}
127 127 assert assigns(:entries).detect {|e| e.name == ' filename with a leading space.txt ' && e.kind == 'file'}
128 128 assert_not_nil assigns(:changesets)
129 129 assert assigns(:changesets).size > 0
130 130 end
131 131
132 132 def test_browse_branch
133 133 assert_equal 0, @repository.changesets.count
134 134 @repository.fetch_changesets
135 135 @project.reload
136 136 assert_equal NUM_REV, @repository.changesets.count
137 137 get :show, :id => PRJ_ID, :rev => 'test_branch'
138 138 assert_response :success
139 139 assert_template 'show'
140 140 assert_not_nil assigns(:entries)
141 141 assert_equal 4, assigns(:entries).size
142 142 assert assigns(:entries).detect {|e| e.name == 'images' && e.kind == 'dir'}
143 143 assert assigns(:entries).detect {|e| e.name == 'sources' && e.kind == 'dir'}
144 144 assert assigns(:entries).detect {|e| e.name == 'README' && e.kind == 'file'}
145 145 assert assigns(:entries).detect {|e| e.name == 'test.txt' && e.kind == 'file'}
146 146 assert_not_nil assigns(:changesets)
147 147 assert assigns(:changesets).size > 0
148 148 end
149 149
150 150 def test_browse_tag
151 151 assert_equal 0, @repository.changesets.count
152 152 @repository.fetch_changesets
153 153 @project.reload
154 154 assert_equal NUM_REV, @repository.changesets.count
155 155 [
156 156 "tag00.lightweight",
157 157 "tag01.annotated",
158 158 ].each do |t1|
159 159 get :show, :id => PRJ_ID, :rev => t1
160 160 assert_response :success
161 161 assert_template 'show'
162 162 assert_not_nil assigns(:entries)
163 163 assert assigns(:entries).size > 0
164 164 assert_not_nil assigns(:changesets)
165 165 assert assigns(:changesets).size > 0
166 166 end
167 167 end
168 168
169 169 def test_browse_directory
170 170 assert_equal 0, @repository.changesets.count
171 171 @repository.fetch_changesets
172 172 @project.reload
173 173 assert_equal NUM_REV, @repository.changesets.count
174 174 get :show, :id => PRJ_ID, :path => repository_path_hash(['images'])[:param]
175 175 assert_response :success
176 176 assert_template 'show'
177 177 assert_not_nil assigns(:entries)
178 178 assert_equal ['edit.png'], assigns(:entries).collect(&:name)
179 179 entry = assigns(:entries).detect {|e| e.name == 'edit.png'}
180 180 assert_not_nil entry
181 181 assert_equal 'file', entry.kind
182 182 assert_equal 'images/edit.png', entry.path
183 183 assert_not_nil assigns(:changesets)
184 184 assert assigns(:changesets).size > 0
185 185 end
186 186
187 187 def test_browse_at_given_revision
188 188 assert_equal 0, @repository.changesets.count
189 189 @repository.fetch_changesets
190 190 @project.reload
191 191 assert_equal NUM_REV, @repository.changesets.count
192 192 get :show, :id => PRJ_ID, :path => repository_path_hash(['images'])[:param],
193 193 :rev => '7234cb2750b63f47bff735edc50a1c0a433c2518'
194 194 assert_response :success
195 195 assert_template 'show'
196 196 assert_not_nil assigns(:entries)
197 197 assert_equal ['delete.png'], assigns(:entries).collect(&:name)
198 198 assert_not_nil assigns(:changesets)
199 199 assert assigns(:changesets).size > 0
200 200 end
201 201
202 202 def test_changes
203 203 get :changes, :id => PRJ_ID,
204 204 :path => repository_path_hash(['images', 'edit.png'])[:param]
205 205 assert_response :success
206 206 assert_template 'changes'
207 207 assert_tag :tag => 'h2', :content => 'edit.png'
208 208 end
209 209
210 210 def test_entry_show
211 211 get :entry, :id => PRJ_ID,
212 212 :path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param]
213 213 assert_response :success
214 214 assert_template 'entry'
215 215 # Line 19
216 216 assert_tag :tag => 'th',
217 217 :content => '11',
218 218 :attributes => { :class => 'line-num' },
219 219 :sibling => { :tag => 'td', :content => /WITHOUT ANY WARRANTY/ }
220 220 end
221 221
222 222 def test_entry_show_latin_1
223 223 if @ruby19_non_utf8_pass
224 224 puts_ruby19_non_utf8_pass()
225 225 elsif WINDOWS_PASS
226 226 puts WINDOWS_SKIP_STR
227 227 elsif JRUBY_SKIP
228 228 puts JRUBY_SKIP_STR
229 229 else
230 230 with_settings :repositories_encodings => 'UTF-8,ISO-8859-1' do
231 231 ['57ca437c', '57ca437c0acbbcb749821fdf3726a1367056d364'].each do |r1|
232 232 get :entry, :id => PRJ_ID,
233 233 :path => repository_path_hash(['latin-1-dir', "test-#{@char_1}.txt"])[:param],
234 234 :rev => r1
235 235 assert_response :success
236 236 assert_template 'entry'
237 237 assert_tag :tag => 'th',
238 238 :content => '1',
239 239 :attributes => { :class => 'line-num' },
240 240 :sibling => { :tag => 'td',
241 241 :content => /test-#{@char_1}.txt/ }
242 242 end
243 243 end
244 244 end
245 245 end
246 246
247 247 def test_entry_download
248 248 get :entry, :id => PRJ_ID,
249 249 :path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param],
250 250 :format => 'raw'
251 251 assert_response :success
252 252 # File content
253 253 assert @response.body.include?('WITHOUT ANY WARRANTY')
254 254 end
255 255
256 256 def test_directory_entry
257 257 get :entry, :id => PRJ_ID,
258 258 :path => repository_path_hash(['sources'])[:param]
259 259 assert_response :success
260 260 assert_template 'show'
261 261 assert_not_nil assigns(:entry)
262 262 assert_equal 'sources', assigns(:entry).name
263 263 end
264 264
265 265 def test_diff
266 assert_equal true, @repository.is_default
267 assert_nil @repository.identifier
266 268 assert_equal 0, @repository.changesets.count
267 269 @repository.fetch_changesets
268 270 @project.reload
269 271 assert_equal NUM_REV, @repository.changesets.count
270 272 # Full diff of changeset 2f9c0091
271 273 ['inline', 'sbs'].each do |dt|
272 274 get :diff,
273 275 :id => PRJ_ID,
274 276 :rev => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7',
275 277 :type => dt
276 278 assert_response :success
277 279 assert_template 'diff'
278 280 # Line 22 removed
279 281 assert_tag :tag => 'th',
280 282 :content => /22/,
281 283 :sibling => { :tag => 'td',
282 284 :attributes => { :class => /diff_out/ },
283 285 :content => /def remove/ }
284 286 assert_tag :tag => 'h2', :content => /2f9c0091/
285 287 end
286 288 end
287 289
288 290 def test_diff_with_rev_and_path
289 291 assert_equal 0, @repository.changesets.count
290 292 @repository.fetch_changesets
291 293 @project.reload
292 294 assert_equal NUM_REV, @repository.changesets.count
293 295 with_settings :diff_max_lines_displayed => 1000 do
294 296 # Full diff of changeset 2f9c0091
295 297 ['inline', 'sbs'].each do |dt|
296 298 get :diff,
297 299 :id => PRJ_ID,
298 300 :rev => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7',
299 301 :path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param],
300 302 :type => dt
301 303 assert_response :success
302 304 assert_template 'diff'
303 305 # Line 22 removed
304 306 assert_tag :tag => 'th',
305 307 :content => '22',
306 308 :sibling => { :tag => 'td',
307 309 :attributes => { :class => /diff_out/ },
308 310 :content => /def remove/ }
309 311 assert_tag :tag => 'h2', :content => /2f9c0091/
310 312 end
311 313 end
312 314 end
313 315
314 316 def test_diff_truncated
315 317 assert_equal 0, @repository.changesets.count
316 318 @repository.fetch_changesets
317 319 @project.reload
318 320 assert_equal NUM_REV, @repository.changesets.count
319 321
320 322 with_settings :diff_max_lines_displayed => 5 do
321 323 # Truncated diff of changeset 2f9c0091
322 324 with_cache do
323 325 with_settings :default_language => 'en' do
324 326 get :diff, :id => PRJ_ID, :type => 'inline',
325 327 :rev => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7'
326 328 assert_response :success
327 329 assert @response.body.include?("... This diff was truncated")
328 330 end
329 331 with_settings :default_language => 'fr' do
330 332 get :diff, :id => PRJ_ID, :type => 'inline',
331 333 :rev => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7'
332 334 assert_response :success
333 335 assert ! @response.body.include?("... This diff was truncated")
334 336 assert @response.body.include?("... Ce diff")
335 337 end
336 338 end
337 339 end
338 340 end
339 341
340 342 def test_diff_two_revs
341 343 assert_equal 0, @repository.changesets.count
342 344 @repository.fetch_changesets
343 345 @project.reload
344 346 assert_equal NUM_REV, @repository.changesets.count
345 347 ['inline', 'sbs'].each do |dt|
346 348 get :diff,
347 349 :id => PRJ_ID,
348 350 :rev => '61b685fbe55ab05b5ac68402d5720c1a6ac973d1',
349 351 :rev_to => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7',
350 352 :type => dt
351 353 assert_response :success
352 354 assert_template 'diff'
353 355 diff = assigns(:diff)
354 356 assert_not_nil diff
355 357 assert_tag :tag => 'h2', :content => /2f9c0091:61b685fb/
358 assert_tag :tag => "form",
359 :attributes => {
360 :action => "/projects/subproject1/repository/revisions/" +
361 "61b685fbe55ab05b5ac68402d5720c1a6ac973d1/diff"
362 }
363 assert_tag :tag => 'input',
364 :attributes => {
365 :id => "rev_to",
366 :name => "rev_to",
367 :type => "hidden",
368 :value => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7'
369 }
356 370 end
357 371 end
358 372
359 373 def test_diff_latin_1
360 374 if @ruby19_non_utf8_pass
361 375 puts_ruby19_non_utf8_pass()
362 376 else
363 377 with_settings :repositories_encodings => 'UTF-8,ISO-8859-1' do
364 378 ['57ca437c', '57ca437c0acbbcb749821fdf3726a1367056d364'].each do |r1|
365 379 ['inline', 'sbs'].each do |dt|
366 380 get :diff, :id => PRJ_ID, :rev => r1, :type => dt
367 381 assert_response :success
368 382 assert_template 'diff'
369 383 assert_tag :tag => 'thead',
370 384 :descendant => {
371 385 :tag => 'th',
372 386 :attributes => { :class => 'filename' } ,
373 387 :content => /latin-1-dir\/test-#{@char_1}.txt/ ,
374 388 },
375 389 :sibling => {
376 390 :tag => 'tbody',
377 391 :descendant => {
378 392 :tag => 'td',
379 393 :attributes => { :class => /diff_in/ },
380 394 :content => /test-#{@char_1}.txt/
381 395 }
382 396 }
383 397 end
384 398 end
385 399 end
386 400 end
387 401 end
388 402
389 403 def test_save_diff_type
390 404 user1 = User.find(1)
391 405 user1.pref[:diff_type] = nil
392 406 user1.preference.save
393 407 user = User.find(1)
394 408 assert_nil user.pref[:diff_type]
395 409
396 410 @request.session[:user_id] = 1 # admin
397 411 get :diff,
398 412 :id => PRJ_ID,
399 413 :rev => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7'
400 414 assert_response :success
401 415 assert_template 'diff'
402 416 user.reload
403 417 assert_equal "inline", user.pref[:diff_type]
404 418 get :diff,
405 419 :id => PRJ_ID,
406 420 :rev => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7',
407 421 :type => 'sbs'
408 422 assert_response :success
409 423 assert_template 'diff'
410 424 user.reload
411 425 assert_equal "sbs", user.pref[:diff_type]
412 426 end
413 427
414 428 def test_annotate
415 429 get :annotate, :id => PRJ_ID,
416 430 :path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param]
417 431 assert_response :success
418 432 assert_template 'annotate'
419 433 # Line 24, changeset 2f9c0091
420 434 assert_tag :tag => 'th', :content => '24',
421 435 :sibling => {
422 436 :tag => 'td',
423 437 :child => {
424 438 :tag => 'a',
425 439 :content => /2f9c0091/
426 440 }
427 441 }
428 442 assert_tag :tag => 'th', :content => '24',
429 443 :sibling => { :tag => 'td', :content => /jsmith/ }
430 444 assert_tag :tag => 'th', :content => '24',
431 445 :sibling => {
432 446 :tag => 'td',
433 447 :child => {
434 448 :tag => 'a',
435 449 :content => /2f9c0091/
436 450 }
437 451 }
438 452 assert_tag :tag => 'th', :content => '24',
439 453 :sibling => { :tag => 'td', :content => /watcher =/ }
440 454 end
441 455
442 456 def test_annotate_at_given_revision
443 457 assert_equal 0, @repository.changesets.count
444 458 @repository.fetch_changesets
445 459 @project.reload
446 460 assert_equal NUM_REV, @repository.changesets.count
447 461 get :annotate, :id => PRJ_ID, :rev => 'deff7',
448 462 :path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param]
449 463 assert_response :success
450 464 assert_template 'annotate'
451 465 assert_tag :tag => 'h2', :content => /@ deff712f/
452 466 end
453 467
454 468 def test_annotate_binary_file
455 469 get :annotate, :id => PRJ_ID,
456 470 :path => repository_path_hash(['images', 'edit.png'])[:param]
457 471 assert_response 500
458 472 assert_tag :tag => 'p', :attributes => { :id => /errorExplanation/ },
459 473 :content => /cannot be annotated/
460 474 end
461 475
462 476 def test_annotate_error_when_too_big
463 477 with_settings :file_max_size_displayed => 1 do
464 478 get :annotate, :id => PRJ_ID,
465 479 :path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param],
466 480 :rev => 'deff712f'
467 481 assert_response 500
468 482 assert_tag :tag => 'p', :attributes => { :id => /errorExplanation/ },
469 483 :content => /exceeds the maximum text file size/
470 484
471 485 get :annotate, :id => PRJ_ID,
472 486 :path => repository_path_hash(['README'])[:param],
473 487 :rev => '7234cb2'
474 488 assert_response :success
475 489 assert_template 'annotate'
476 490 end
477 491 end
478 492
479 493 def test_annotate_latin_1
480 494 if @ruby19_non_utf8_pass
481 495 puts_ruby19_non_utf8_pass()
482 496 elsif WINDOWS_PASS
483 497 puts WINDOWS_SKIP_STR
484 498 elsif JRUBY_SKIP
485 499 puts JRUBY_SKIP_STR
486 500 else
487 501 with_settings :repositories_encodings => 'UTF-8,ISO-8859-1' do
488 502 ['57ca437c', '57ca437c0acbbcb749821fdf3726a1367056d364'].each do |r1|
489 503 get :annotate, :id => PRJ_ID,
490 504 :path => repository_path_hash(['latin-1-dir', "test-#{@char_1}.txt"])[:param],
491 505 :rev => r1
492 506 assert_tag :tag => 'th',
493 507 :content => '1',
494 508 :attributes => { :class => 'line-num' },
495 509 :sibling => { :tag => 'td',
496 510 :content => /test-#{@char_1}.txt/ }
497 511 end
498 512 end
499 513 end
500 514 end
501 515
502 516 def test_revision
503 517 assert_equal 0, @repository.changesets.count
504 518 @repository.fetch_changesets
505 519 @project.reload
506 520 assert_equal NUM_REV, @repository.changesets.count
507 521 ['61b685fbe55ab05b5ac68402d5720c1a6ac973d1', '61b685f'].each do |r|
508 522 get :revision, :id => PRJ_ID, :rev => r
509 523 assert_response :success
510 524 assert_template 'revision'
511 525 end
512 526 end
513 527
514 528 def test_empty_revision
515 529 assert_equal 0, @repository.changesets.count
516 530 @repository.fetch_changesets
517 531 @project.reload
518 532 assert_equal NUM_REV, @repository.changesets.count
519 533 ['', ' ', nil].each do |r|
520 534 get :revision, :id => PRJ_ID, :rev => r
521 535 assert_response 404
522 536 assert_error_tag :content => /was not found/
523 537 end
524 538 end
525 539
526 540 def test_destroy_valid_repository
527 541 @request.session[:user_id] = 1 # admin
528 542 assert_equal 0, @repository.changesets.count
529 543 @repository.fetch_changesets
530 544 @project.reload
531 545 assert_equal NUM_REV, @repository.changesets.count
532 546
533 547 assert_difference 'Repository.count', -1 do
534 548 delete :destroy, :id => @repository.id
535 549 end
536 550 assert_response 302
537 551 @project.reload
538 552 assert_nil @project.repository
539 553 end
540 554
541 555 def test_destroy_invalid_repository
542 556 @request.session[:user_id] = 1 # admin
543 557 @project.repository.destroy
544 558 @repository = Repository::Git.create!(
545 559 :project => @project,
546 560 :url => "/invalid",
547 561 :path_encoding => 'ISO-8859-1'
548 562 )
549 563 @repository.fetch_changesets
550 564 @repository.reload
551 565 assert_equal 0, @repository.changesets.count
552 566
553 567 assert_difference 'Repository.count', -1 do
554 568 delete :destroy, :id => @repository.id
555 569 end
556 570 assert_response 302
557 571 @project.reload
558 572 assert_nil @project.repository
559 573 end
560 574
561 575 private
562 576
563 577 def puts_ruby19_non_utf8_pass
564 578 puts "TODO: This test fails in Ruby 1.9 " +
565 579 "and Encoding.default_external is not UTF-8. " +
566 580 "Current value is '#{Encoding.default_external.to_s}'"
567 581 end
568 582 else
569 583 puts "Git test repository NOT FOUND. Skipping functional tests !!!"
570 584 def test_fake; assert true end
571 585 end
572 586
573 587 private
574 588 def with_cache(&block)
575 589 before = ActionController::Base.perform_caching
576 590 ActionController::Base.perform_caching = true
577 591 block.call
578 592 ActionController::Base.perform_caching = before
579 593 end
580 594 end
General Comments 0
You need to be logged in to leave comments. Login now