require "test_helper"
class PageLocaleTest < ActionDispatch::IntegrationTest
- def setup
- I18n.locale = "en"
- end
-
- def teardown
- I18n.locale = "en"
- end
-
def test_defaulting
user = create(:user, :languages => [])
follow_redirect!
get "/diary/new"
- assert_equal [], User.find(user.id).languages
+ assert_empty User.find(user.id).languages
assert_select "html[lang=?]", "en"
get "/diary/new", :headers => { "HTTP_ACCEPT_LANGUAGE" => "fr, en" }