summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/integration/application_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/integration/application_test.rb b/test/integration/application_test.rb
index e70277a2e..e40dda8ea 100644
--- a/test/integration/application_test.rb
+++ b/test/integration/application_test.rb
@@ -76,4 +76,15 @@ class ApplicationTest < ActionDispatch::IntegrationTest
ensure
ActionController::Base.allow_forgery_protection = false
end
+
+ def test_localization_should_be_set_correctly_on_invalid_token
+ ActionController::Base.allow_forgery_protection = true
+ Setting.default_language = 'en'
+ post 'issues', { }, 'HTTP_ACCEPT_LANGUAGE' => 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3'
+ assert_response 422
+ assert_equal :fr, current_language
+ assert_select "html[lang=?]", "fr"
+ ensure
+ ActionController::Base.allow_forgery_protection = false
+ end
end