From e706aaff2c90a77b41fc8b3bd3d3d5f2c7aaeae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?= Date: Sun, 6 Sep 2015 12:40:13 +0200 Subject: [PATCH] adds extra specs for debate's cache --- spec/models/debate_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/models/debate_spec.rb b/spec/models/debate_spec.rb index 39ba93e51..c36031089 100644 --- a/spec/models/debate_spec.rb +++ b/spec/models/debate_spec.rb @@ -286,6 +286,16 @@ describe Debate do .to change { debate.updated_at } end + it "should expire cache when hidden" do + expect { debate.hide } + .to change { debate.updated_at } + end + + it "should expire cache when the author is hidden" do + expect { debate.author.hide } + .to change { [debate.reload.updated_at, debate.author.updated_at] } + end + it "should expire cache when its author changes" do expect { debate.author.update(username: "Eva") } .to change { [debate.reload.updated_at, debate.author.updated_at] }