From 913ba1c4d20b61a0e3faed5cdfeb89f11251d28f Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Wed, 5 May 2021 00:05:42 +0100 Subject: [PATCH] Add required DB cleaner setup code --- spec/lib/open_food_network/i18n_config_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/lib/open_food_network/i18n_config_spec.rb b/spec/lib/open_food_network/i18n_config_spec.rb index 198c0c0cdca..611f677a631 100644 --- a/spec/lib/open_food_network/i18n_config_spec.rb +++ b/spec/lib/open_food_network/i18n_config_spec.rb @@ -5,6 +5,14 @@ module OpenFoodNetwork describe I18nConfig do + before do + # These are only needed here because we are stubbing ENV elsewhere in this file + # Here we make these calls to ENV return a value and that makes database_cleaner work + allow(ENV).to receive(:[]).with("DATABASE_CLEANER_ALLOW_PRODUCTION").and_return("false") + allow(ENV).to receive(:[]).with("DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL"). + and_return("false") + end + context "in default test configuration" do before do allow(ENV).to receive(:[]).with("LOCALE").and_return("en")