class LocaleTest < ActionDispatch::IntegrationTest
fixtures :users
+ def setup
+ I18n.locale = "en"
+ end
+
+ def teardown
+ I18n.locale = "en"
+ end
+
def test_defaulting
user = users(:second_public_user)
assert_equal [], User.find(user.id).languages
assert_select "html[lang=?]", "en"
- get "/diary/new", {}, { "HTTP_ACCEPT_LANGUAGE" => "fr, en" }
+ get "/diary/new", {}, { "HTTP_ACCEPT_LANGUAGE" => "fr, en" }
assert_equal %w(fr en), User.find(user.id).languages
assert_select "html[lang=?]", "fr"
end