From b0f53ae97c36cbe2e94fc4fd6104b70a9589b92c Mon Sep 17 00:00:00 2001 From: Alban Peignier Date: Wed, 25 Apr 2018 23:42:44 +0200 Subject: Fixes problems in CleanUp specs. Refs #5372 --- spec/models/clean_up_spec.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spec/models/clean_up_spec.rb b/spec/models/clean_up_spec.rb index 2753c8718..afd2d8721 100644 --- a/spec/models/clean_up_spec.rb +++ b/spec/models/clean_up_spec.rb @@ -98,7 +98,13 @@ RSpec.describe CleanUp, :type => :model do end context '#clean' do - let(:cleaner) { create(:clean_up, date_type: :before) } + let(:referential) { Referential.new } + let(:cleaner) { create(:clean_up, date_type: :before, referential: referential) } + + before do + allow(referential).to receive(:switch) + end + it 'should call destroy_time_tables_before' do cleaner.date_type = :before -- cgit v1.2.3