From cc7b5e2df359ac4be63e876ffbeb03084413d991 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Fri, 3 Jul 2020 16:28:18 +0200 Subject: [PATCH] Add pending test for setting locale from cookies during login This test currently fails --- spec/features/consumer/authentication_spec.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/spec/features/consumer/authentication_spec.rb b/spec/features/consumer/authentication_spec.rb index 3e676b4c1e..75f3d519d0 100644 --- a/spec/features/consumer/authentication_spec.rb +++ b/spec/features/consumer/authentication_spec.rb @@ -169,6 +169,24 @@ feature "Authentication", js: true do expect(user.reload.locale).to eq "en" end end + + context "when the user has never selected a locale, but one has been selected before login" do + before do + user.update!(locale: nil) + end + + xit "logs in successfully and uses the locale from cookies" do + page.driver.browser.manage.add_cookie(name: 'locale', value: 'es') + + fill_in_and_submit_login_form(user) + expect_logged_in + + expect(page).to have_content I18n.t(:home_shop, locale: :es).upcase + expect(user.reload.locale).to eq "es" + + page.driver.browser.manage.delete_cookie('locale') + end + end end end end