Set globalize fallbacks for requests

New version of globalize uses RequestStore gem to store I18n.locale and
Globalize.fallbacks in a per request basis to avoid collissions between
different requests. This gem update broke Globalize.fallback results
because it tries to fetch fallbacks from RequestStore, where there is no
locale fallbacks definition.
This commit is contained in:
Senén Rodero Rodríguez
2019-01-28 23:12:09 +01:00
committed by voodoorai2000
parent 3d04b388ad
commit ba9e9887ed

View File

@@ -56,6 +56,22 @@ shared_examples "translatable" do |factory_name, path_name, input_fields, textar
end
end
scenario "should show first available fallback when current locale translation does not exist", :js do
attributes = fields.product(%i[fr]).map do |field, locale|
[:"#{field}_#{locale}", text_for(field, locale)]
end.to_h
translatable.update(attributes)
visit path
select "English", from: :translation_locale
click_link "Remove language"
select "Español", from: :translation_locale
click_link "Remove language"
click_button update_button_text
expect(page).to have_content "en Français"
end
scenario "Add a translation", :js do
visit path