@@ -29,6 +29,9 class RepositoriesFilesystemControllerTest < ActionController::TestCase | |||||
29 | PRJ_ID = 3 |
|
29 | PRJ_ID = 3 | |
30 |
|
30 | |||
31 | def setup |
|
31 | def setup | |
|
32 | @ruby19_non_utf8_pass = | |||
|
33 | (RUBY_VERSION >= '1.9' && Encoding.default_external.to_s != 'UTF-8') | |||
|
34 | ||||
32 | @controller = RepositoriesController.new |
|
35 | @controller = RepositoriesController.new | |
33 | @request = ActionController::TestRequest.new |
|
36 | @request = ActionController::TestRequest.new | |
34 | @response = ActionController::TestResponse.new |
|
37 | @response = ActionController::TestResponse.new | |
@@ -80,6 +83,18 class RepositoriesFilesystemControllerTest < ActionController::TestCase | |||||
80 | :content => '2', |
|
83 | :content => '2', | |
81 | :attributes => { :class => 'line-num' }, |
|
84 | :attributes => { :class => 'line-num' }, | |
82 | :sibling => { :tag => 'td', :content => /japanese/ } |
|
85 | :sibling => { :tag => 'td', :content => /japanese/ } | |
|
86 | if @ruby19_non_utf8_pass | |||
|
87 | puts "TODO: show repository file contents test fails in Ruby 1.9 " + | |||
|
88 | "and Encoding.default_external is not UTF-8. " + | |||
|
89 | "Current value is '#{Encoding.default_external.to_s}'" | |||
|
90 | else | |||
|
91 | str_japanese = "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e" | |||
|
92 | str_japanese.force_encoding('UTF-8') if str_japanese.respond_to?(:force_encoding) | |||
|
93 | assert_tag :tag => 'th', | |||
|
94 | :content => '3', | |||
|
95 | :attributes => { :class => 'line-num' }, | |||
|
96 | :sibling => { :tag => 'td', :content => /#{str_japanese}/ } | |||
|
97 | end | |||
83 | end |
|
98 | end | |
84 | end |
|
99 | end | |
85 |
|
100 |
General Comments 0
You need to be logged in to leave comments.
Login now