From 74dbe877d8f2e1c32ebe9ec40020a54ee3771f95 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 20 Mar 2017 16:15:23 -0400 Subject: [PATCH] test for side effect without mock --- spec/services/post_timestamp_changer_spec.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/services/post_timestamp_changer_spec.rb b/spec/services/post_timestamp_changer_spec.rb index bc0b246f162..7c3651bf234 100644 --- a/spec/services/post_timestamp_changer_spec.rb +++ b/spec/services/post_timestamp_changer_spec.rb @@ -50,8 +50,13 @@ describe PostTimestampChanger do end it 'deletes the stats cache' do - $redis.expects(:del).twice + $redis.set AdminDashboardData.stats_cache_key, "X" + $redis.set About.stats_cache_key, "X" + PostTimestampChanger.new(params).change! + + expect($redis.get(AdminDashboardData.stats_cache_key)).to eq(nil) + expect($redis.get(About.stats_cache_key)).to eq(nil) end end end