explicitly set encoding UTF-8 (#16107)

Default Ruby source file encoding changed in Ruby 2.0.0.
https://bugs.ruby-lang.org/issues/6679

git-svn-id: http://svn.redmine.org/redmine/trunk@12918 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2014-02-22 15:55:35 +00:00
parent ad8c02ca82
commit c6f71f727b
1 changed files with 6 additions and 1 deletions

View File

@ -41,8 +41,13 @@ class Redmine::ApiTest::AuthenticationTest < Redmine::ApiTest::Base
end
def test_invalid_utf8_credentials_should_not_trigger_an_error
invalid_utf8 = "\x82"
if invalid_utf8.respond_to?(:force_encoding)
invalid_utf8.force_encoding('UTF-8')
assert !invalid_utf8.valid_encoding?
end
assert_nothing_raised do
get '/users/current.xml', {}, credentials("\x82", "foo")
get '/users/current.xml', {}, credentials(invalid_utf8, "foo")
end
end