Test Translatable logic with a locale with non-underscored name

In the past there have been issues with the `pt-BR` locale because
it has a hyphen `-` and a uppercase letters.

I am adding the test only to spec/features/translations_spec.rb (which
tests Milestones) for now. We might want to also add it to the other
translatable resource specs in the future (banners, etc.).
This commit is contained in:
Marko Lovic
2018-08-28 11:08:03 +02:00
committed by Javi Martín
parent f2b903e869
commit d2dd5f2a58

View File

@@ -83,6 +83,26 @@ feature "Translations" do
expect(page).not_to have_content "Description in English"
end
scenario "Add a translation for a locale with non-underscored name", :js do
visit @edit_milestone_url
select "Português", from: "translation_locale"
fill_in 'budget_investment_milestone_description_pt_br', with: 'Description in pt-BR'
click_button 'Update milestone'
expect(page).to have_content "Milestone updated successfully"
visit budget_investment_path(investment.budget, investment)
click_link("Milestones (1)")
expect(page).to have_content("Description in English")
select('Português', from: 'locale-switcher')
click_link("Seguimiento (1)")
expect(page).to have_content('Description in pt-BR')
end
context "Globalize javascript interface" do
scenario "Highlight current locale", :js do