Don't run specs if there are custom fallbacks

This spec depends on French falling back to Spanish and was failing on
forks using a different fallback.
This commit is contained in:
Javi Martín
2018-10-17 01:10:13 +02:00
parent 2e6644d513
commit f5bb3c64a1

View File

@@ -141,6 +141,10 @@ feature 'Admin poll questions' do
end end
scenario "uses fallback if name is not translated to current locale", :js do scenario "uses fallback if name is not translated to current locale", :js do
unless globalize_french_fallbacks.first == :es
skip("Spec only useful when French falls back to Spanish")
end
visit @edit_question_url visit @edit_question_url
expect(page).to have_select('poll_question_poll_id', options: [poll.name_en]) expect(page).to have_select('poll_question_poll_id', options: [poll.name_en])
@@ -150,4 +154,8 @@ feature 'Admin poll questions' do
expect(page).to have_select('poll_question_poll_id', options: [poll.name_es]) expect(page).to have_select('poll_question_poll_id', options: [poll.name_es])
end end
end end
def globalize_french_fallbacks
Globalize.fallbacks(:fr).reject { |locale| locale.match(/fr/) }
end
end end