Remove redundant translation specs

This commit is contained in:
Angel Perez
2018-07-26 18:41:13 -04:00
parent 26deb02937
commit 1255389ef7

View File

@@ -44,75 +44,6 @@ feature "Admin custom information texts" do
expect(page).to have_content 'See all recommended debates'
end
scenario 'can be changed and they are correctly shown' do
content = create(:i18n_content)
old_text = content.value_en
visit admin_site_customization_information_texts_path
select 'English', from: 'translation_locale'
fill_in "contents_content_#{content.key}values_value_en", with: 'Custom debates text'
click_button "Save"
visit debates_path
expect(page).to have_content 'Custom debates text'
expect(page).not_to have_content old_text
end
scenario 'change according to current locale', :js do
content = create(:i18n_content)
visit debates_path
expect(page).to have_content content.value_en
expect(page).not_to have_content content.value_es
select('Español', from: 'locale-switcher')
expect(page).to have_content content.value_es
expect(page).not_to have_content content.value_en
end
scenario 'languages can be added', :js do
content = create(:i18n_content, key: 'debates.form.debate_text')
visit admin_site_customization_information_texts_path(locale: :fr)
select 'Français', from: 'translation_locale'
click_link 'Français'
expect(page).to have_css('a.is-active', text: 'Français')
fill_in "contents_content_#{content.key}values_value_fr", with: 'Nouvelle titre en français'
click_button 'Enregistrer'
content.reload
expect(page).to have_content 'Nouvelle titre en français'
expect(content.value_fr).to eq 'Nouvelle titre en français'
end
scenario 'languages can be removed', :js do
content = create(:i18n_content)
visit admin_site_customization_information_texts_path
click_link 'Español'
expect(page).to have_css('a.is-active', text: 'Español')
click_link 'Remove language'
expect(page).not_to have_link('Español')
click_button 'Save'
content.reload
expect(content.value_es).to be nil
expect(page).not_to have_content 'Texto en español'
end
context "Globalization" do
scenario "Add a translation", :js do
@@ -223,7 +154,7 @@ feature "Admin custom information texts" do
expect(page).to have_field("contents_content_#{key}values_value_es", with: 'Título')
end
scenario "Select a locale and add it to the milestone form", :js do
scenario "Select a locale and add it to the form", :js do
key = "debates.form.debate_title"
visit admin_site_customization_information_texts_path