X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/07673278f13c87fd2e073b041970bbdd45eebe86..47ff3a8f97301ec84a5b7672706e26b52065b004:/test/integration/page_locale_test.rb diff --git a/test/integration/page_locale_test.rb b/test/integration/page_locale_test.rb index ac34274a4..2c4939b05 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,14 +12,14 @@ class PageLocaleTest < ActionDispatch::IntegrationTest def test_defaulting user = create(:user, :languages => []) - post "/login", :username => user.email, :password => "test" + post "/login", :params => { :username => user.email, :password => "test" } follow_redirect! - get "/diary/new", {} + get "/diary/new" assert_equal [], User.find(user.id).languages assert_select "html[lang=?]", "en" - get "/diary/new", {}, { "HTTP_ACCEPT_LANGUAGE" => "fr, en" } + get "/diary/new", :headers => { "HTTP_ACCEPT_LANGUAGE" => "fr, en" } assert_equal %w[fr en], User.find(user.id).languages assert_select "html[lang=?]", "fr" end @@ -31,16 +30,16 @@ class PageLocaleTest < ActionDispatch::IntegrationTest get "/diary" assert_select "html[lang=?]", "en" - get "/diary", :locale => "es" + get "/diary", :params => { :locale => "es" } assert_select "html[lang=?]", "es" - post "/login", :username => user.email, :password => "test" + post "/login", :params => { :username => user.email, :password => "test" } follow_redirect! get "/diary" assert_select "html[lang=?]", "de" - get "/diary", :locale => "fr" + get "/diary", :params => { :locale => "fr" } assert_select "html[lang=?]", "fr" end end