From c6f71f727bc73188ce7285c6e19bf50553246ec7 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sat, 22 Feb 2014 15:55:35 +0000 Subject: [PATCH] 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 --- test/integration/api_test/authentication_test.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- 2.39.5