From f890c4a31d565cd17c2dbcc9b25730e2cad5098e Mon Sep 17 00:00:00 2001 From: Pau Perez Date: Tue, 8 Sep 2020 14:12:17 +0200 Subject: [PATCH] Fix LogEntry spec --- spec/lib/tasks/data/remove_transient_data_spec.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/spec/lib/tasks/data/remove_transient_data_spec.rb b/spec/lib/tasks/data/remove_transient_data_spec.rb index c84a025478..9e61b3f65b 100644 --- a/spec/lib/tasks/data/remove_transient_data_spec.rb +++ b/spec/lib/tasks/data/remove_transient_data_spec.rb @@ -21,12 +21,11 @@ describe RemoveTransientData do expect(Spree::StateChange.all).to be_empty end - it 'deletes log entries older than a month' do + it 'deletes log entries older than retention_period' do Spree::LogEntry.create(created_at: retention_period - 1.day) - RemoveTransientData.new.call - - expect(Spree::LogEntry.all).to be_empty + expect { RemoveTransientData.new.call } + .to change(Spree::LogEntry, :count).by(-1) end it 'deletes sessions older than retention_period' do