X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/5b33f3f8e31c62bc3e5db1d5b120533c3afdde68..6b44a1976cf07ba50ba8aed8b34434e69a45e62d:/test/integration/page_locale_test.rb?ds=inline diff --git a/test/integration/page_locale_test.rb b/test/integration/page_locale_test.rb index c5e0d0ae3..9c42d9be7 100644 --- a/test/integration/page_locale_test.rb +++ b/test/integration/page_locale_test.rb @@ -13,13 +13,14 @@ class PageLocaleTest < ActionDispatch::IntegrationTest def test_defaulting user = create(:user, :languages => []) - post_via_redirect "/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 @@ -30,15 +31,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_via_redirect "/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