From f5bb3c64a16b414d22d6096b5bad13b0bb1c65bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 17 Oct 2018 01:10:13 +0200 Subject: [PATCH] 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. --- spec/features/admin/poll/questions_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/features/admin/poll/questions_spec.rb b/spec/features/admin/poll/questions_spec.rb index e5ed6bf96..4374800f2 100644 --- a/spec/features/admin/poll/questions_spec.rb +++ b/spec/features/admin/poll/questions_spec.rb @@ -141,6 +141,10 @@ feature 'Admin poll questions' do end 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 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]) end end + + def globalize_french_fallbacks + Globalize.fallbacks(:fr).reject { |locale| locale.match(/fr/) } + end end