add system spec for default custom pages translations generated by seed

This commit is contained in:
Jakub Krzus
2021-03-22 19:32:35 +00:00
parent ca047b9a52
commit 0d093d93d8

View File

@@ -26,6 +26,21 @@ describe "Admin custom pages", :admin do
expect(page).to have_content slug expect(page).to have_content slug
end end
end end
scenario "should contain all custom pages translations populated by db:seeds" do
paths = { accessibility: "pages.accessibility.title", conditions: "pages.conditions.title",
faq: "pages.help.faq.page.title", privacy: "pages.privacy.title",
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)
end
end
end end
context "Create" do context "Create" do