X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/cb87f02642d0097ebc067ca1f9371dde274a41e3..4c785792fbfa8fc073b3a782875609426a49404a:/test/integration/page_locale_test.rb diff --git a/test/integration/page_locale_test.rb b/test/integration/page_locale_test.rb index 9c42d9be7..b42865ae4 100644 --- a/test/integration/page_locale_test.rb +++ b/test/integration/page_locale_test.rb @@ -3,7 +3,6 @@ require "test_helper" class PageLocaleTest < ActionDispatch::IntegrationTest def setup I18n.locale = "en" - stub_hostip_requests end def teardown @@ -13,11 +12,13 @@ class PageLocaleTest < ActionDispatch::IntegrationTest def test_defaulting user = create(:user, :languages => []) + get "/login" + follow_redirect! post "/login", :params => { :username => user.email, :password => "test" } 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" } @@ -34,6 +35,8 @@ class PageLocaleTest < ActionDispatch::IntegrationTest get "/diary", :params => { :locale => "es" } assert_select "html[lang=?]", "es" + get "/login" + follow_redirect! post "/login", :params => { :username => user.email, :password => "test" } follow_redirect!