diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2014-02-22 15:55:35 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2014-02-22 15:55:35 +0000 |
commit | c6f71f727bc73188ce7285c6e19bf50553246ec7 (patch) | |
tree | 1440ba97bc1f60947e08a45ef91d2e641453f0cc /test/integration/api_test/authentication_test.rb | |
parent | ad8c02ca825b471885b211cb158342d8b6bd975b (diff) | |
download | redmine-c6f71f727bc73188ce7285c6e19bf50553246ec7.tar.gz redmine-c6f71f727bc73188ce7285c6e19bf50553246ec7.zip |
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
Diffstat (limited to 'test/integration/api_test/authentication_test.rb')
-rw-r--r-- | test/integration/api_test/authentication_test.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/integration/api_test/authentication_test.rb b/test/integration/api_test/authentication_test.rb index 5ec6a8824..16c589d3e 100644 --- a/test/integration/api_test/authentication_test.rb +++ b/test/integration/api_test/authentication_test.rb @@ -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 |