diff --git a/spec/system/admin/site_customization/pages_spec.rb b/spec/system/admin/site_customization/pages_spec.rb index a0f68e238..617118907 100644 --- a/spec/system/admin/site_customization/pages_spec.rb +++ b/spec/system/admin/site_customization/pages_spec.rb @@ -1,6 +1,12 @@ require "rails_helper" describe "Admin custom pages", :admin do + I18n.available_locales = [:ar, :bg, :bs, :ca, :cs, :da, :de, :el, :en, :es, :"es-PE", :eu, :fa, :fr, + :gl, :he, :hr, :id, :it, :ka, :nl, :oc, :pl, :"pt-BR", + :ro, :ru, :sl, :sq, :so, :sr, :sv, :tr, :val, :"zh-CN", :"zh-TW"] + SiteCustomization::Page.destroy_all + Rails.application.load_seed + context "Index" do scenario "lists all created custom pages" do custom_page = create(:site_customization_page) @@ -33,12 +39,12 @@ describe "Admin custom pages", :admin do welcome_not_verified: "welcome.welcome.title", welcome_level_two_verified: "welcome.welcome.title", welcome_level_three_verified: "welcome.welcome.title" } - locale = :fr - I18n.locale = locale - - paths.each do |slug, path| - site = SiteCustomization::Page.find_by(slug: slug).translations.find_by(locale: locale) - expect(site.title).to eq I18n.t(path) + I18n.available_locales.each do |locale| + I18n.locale = locale + paths.each do |slug, path| + site = SiteCustomization::Page.find_by(slug: slug).translations.find_by(locale: locale) + expect(site.title).to eq I18n.t(path) + end end end end