summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/integration/api_test/authentication_test.rb7
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