Fix custom translations with options

This commit is contained in:
decabeza
2020-04-10 12:17:27 +02:00
parent 14106ce800
commit af1e11838c
2 changed files with 27 additions and 1 deletions

View File

@@ -30,4 +30,26 @@ describe "Custom information texts" do
expect(page).not_to have_content "Help about proposals"
end
end
scenario "Show custom text with options", :js do
admin = create(:administrator)
user = create(:user, username: "Rachel")
create(:budget_investment, author_id: user.id)
intro_key = "mailers.budget_investment_created.intro"
create(:i18n_content, key: intro_key, value_en: "Hi %{author}")
login_as(admin.user)
visit admin_site_customization_information_texts_path(tab: "mailers")
expect(page).to have_content "Hi %{author}"
fill_in "contents[content_#{intro_key}]values[value_en]", with: "Custom hi to %{author}"
click_button "Save"
visit admin_system_email_view_path("budget_investment_created")
expect(page).to have_content "Custom hi to Rachel"
expect(page).not_to have_content "%{author}"
end
end