From c4bd9208ce00b75518525e1bb630e7e9b93a11d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 May 2021 20:50:20 +0000 Subject: [PATCH 1/3] Bump database_cleaner from 1.99.0 to 2.0.1 Bumps [database_cleaner](https://github.com/DatabaseCleaner/database_cleaner) from 1.99.0 to 2.0.1. - [Release notes](https://github.com/DatabaseCleaner/database_cleaner/releases) - [Changelog](https://github.com/DatabaseCleaner/database_cleaner/blob/main/History.rdoc) - [Commits](https://github.com/DatabaseCleaner/database_cleaner/compare/v1.99.0...v2.0.1) Signed-off-by: dependabot[bot] --- Gemfile.lock | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 42814099098..832d5047363 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -194,7 +194,12 @@ GEM addressable daemons (1.4.0) dalli (2.7.11) - database_cleaner (1.99.0) + database_cleaner (2.0.1) + database_cleaner-active_record (~> 2.0.0) + database_cleaner-active_record (2.0.0) + activerecord (>= 5.a) + database_cleaner-core (~> 2.0.0) + database_cleaner-core (2.0.1) ddtrace (0.49.0) ffi (~> 1.0) msgpack From dc1cdf42540e0437240395c3490a04dd509cbd10 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Wed, 5 May 2021 00:05:42 +0100 Subject: [PATCH 2/3] 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") From 30e2be13f029d1d7f2a16a815db5ad71bd8e752f Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 1 Jun 2021 19:47:09 +0200 Subject: [PATCH 3/3] Update spec/lib/open_food_network/i18n_config_spec.rb --- spec/lib/open_food_network/i18n_config_spec.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/spec/lib/open_food_network/i18n_config_spec.rb b/spec/lib/open_food_network/i18n_config_spec.rb index 611f677a631..b69aa8b745f 100644 --- a/spec/lib/open_food_network/i18n_config_spec.rb +++ b/spec/lib/open_food_network/i18n_config_spec.rb @@ -6,11 +6,8 @@ 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") + # Allow non-stubbed calls to ENV to proceed + allow(ENV).to receive(:[]).and_call_original end context "in default test configuration" do