X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/50b2f4f656b82112fce4939da26a1afc6b140e89..de8ee536b1e6d511f6d943b2e9afabf778979e6b:/test/integration/page_locale_test.rb?ds=sidebyside diff --git a/test/integration/page_locale_test.rb b/test/integration/page_locale_test.rb index 2c4939b05..b42865ae4 100644 --- a/test/integration/page_locale_test.rb +++ b/test/integration/page_locale_test.rb @@ -12,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" } @@ -33,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!