From c60ce4d2c9a30369a611b425b5fc05b885430b37 Mon Sep 17 00:00:00 2001 From: Ernesto Tagwerker Date: Mon, 18 Oct 2021 22:13:52 -0400 Subject: [PATCH] Change expectation for the #strategy method in the Cleaners class --- spec/database_cleaner/cleaners_spec.rb | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/spec/database_cleaner/cleaners_spec.rb b/spec/database_cleaner/cleaners_spec.rb index 6411f90..6971716 100644 --- a/spec/database_cleaner/cleaners_spec.rb +++ b/spec/database_cleaner/cleaners_spec.rb @@ -57,10 +57,6 @@ RSpec.describe DatabaseCleaner::Cleaners do context "single orm single db" do let!(:cleaner) { cleaners[:active_record] } - it "should proxy strategy" do - expect(cleaners.strategy).to eq(cleaner.strategy) - end - it "should proxy strategy=" do stratagem = double("stratagem") expect(cleaner).to receive(:strategy=).with(stratagem) @@ -171,11 +167,16 @@ RSpec.describe DatabaseCleaner::Cleaners do }) end + let(:result) do + { + :active_record_1 => :truncation, + :active_record_2 => :truncation, + :data_mapper_1 => :truncation + } + end + it "should proxy #strategy to all cleaners and return a single result" do - expect(cleaners.strategy) - .to eq(active_record_1.strategy) - .and eq(active_record_2.strategy) - .and eq(data_mapper_1.strategy) + expect(cleaners.strategy).to eq(result) end end