mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-02 21:57:17 +00:00
Update multilingual_spec to work with Selenium
This commit is contained in:
committed by
luisramos0
parent
bbaf6359f3
commit
23fa57ff6d
@@ -4,6 +4,7 @@ feature 'Multilingual', js: true do
|
||||
include AuthenticationWorkflow
|
||||
include WebHelper
|
||||
include ShopWorkflow
|
||||
include CookieHelper
|
||||
|
||||
it 'has two locales available' do
|
||||
expect(Rails.application.config.i18n[:default_locale]).to eq 'en'
|
||||
@@ -22,7 +23,7 @@ feature 'Multilingual', js: true do
|
||||
visit root_path
|
||||
expect(get_i18n_locale).to eq 'en'
|
||||
expect(get_i18n_translation('label_shops')).to eq 'Shops'
|
||||
expect(page.driver.browser.cookies['locale']).to be_nil
|
||||
expect(cookie_named('locale')).to be_nil
|
||||
expect(page).to have_content 'Interested in getting on the Open Food Network?'
|
||||
expect(page).to have_content 'SHOPS'
|
||||
|
||||
@@ -136,6 +137,6 @@ feature 'Multilingual', js: true do
|
||||
end
|
||||
|
||||
def expect_menu_and_cookie_in_es
|
||||
expect(page.driver.browser.cookies['locale'].value).to eq 'es'
|
||||
expect(cookie_named('locale')[:value]).to eq 'es'
|
||||
expect(page).to have_content 'TIENDAS'
|
||||
end
|
||||
|
||||
5
spec/support/request/cookie_helper.rb
Normal file
5
spec/support/request/cookie_helper.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
module CookieHelper
|
||||
def cookie_named(name)
|
||||
Capybara.current_session.driver.browser.manage.cookie_named(name)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user