aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/request_test.rb6
-rw-r--r--actionpack/test/template/text_helper_test.rb8
2 files changed, 8 insertions, 6 deletions
diff --git a/actionpack/test/controller/request_test.rb b/actionpack/test/controller/request_test.rb
index 4d645f56e0..6916e13417 100644
--- a/actionpack/test/controller/request_test.rb
+++ b/actionpack/test/controller/request_test.rb
@@ -835,8 +835,10 @@ class MultipartRequestParameterParsingTest < Test::Unit::TestCase
assert_equal 'bar', params['foo']
# Ruby CGI doesn't handle multipart/mixed for us.
- assert_kind_of String, params['files']
- assert_equal 19756, params['files'].size
+ files = params['files']
+ assert_kind_of String, files
+ files.force_encoding('ASCII-8BIT') if files.respond_to?(:force_encoding)
+ assert_equal 19756, files.size
end
private
diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb
index 0cd83334d5..7d92bce4bd 100644
--- a/actionpack/test/template/text_helper_test.rb
+++ b/actionpack/test/template/text_helper_test.rb
@@ -136,16 +136,16 @@ class TextHelperTest < Test::Unit::TestCase
if RUBY_VERSION < '1.9'
def test_excerpt_with_utf8
with_kcode('u') do
- assert_equal("...fficiency could not be...", excerpt("That's why efficiency could not be helped", 'could', 8))
+ assert_equal("...\357\254\203ciency could not be...", excerpt("That's why e\357\254\203ciency could not be helped", 'could', 8))
end
with_kcode('none') do
- assert_equal("...\203ciency could not be...", excerpt("That's why efficiency could not be helped", 'could', 8))
+ assert_equal("...\203ciency could not be...", excerpt("That's why e\357\254\203ciency could not be helped", 'could', 8))
end
end
else
def test_excerpt_with_utf8
- assert_equal("...fficiency could not be...".force_encoding('UTF-8'), excerpt("That's why efficiency could not be helped".force_encoding('UTF-8'), 'could', 8))
- assert_equal("...\203ciency could not be...", excerpt("That's why efficiency could not be helped", 'could', 8))
+ assert_equal("...\357\254\203ciency could not be...".force_encoding('UTF-8'), excerpt("That's why e\357\254\203ciency could not be helped".force_encoding('UTF-8'), 'could', 8))
+ assert_equal("...\203ciency could not be...", excerpt("That's why e\357\254\203ciency could not be helped", 'could', 8))
end
end