diff --git a/spec/models/debate_spec.rb b/spec/models/debate_spec.rb index 39ba93e519e..c36031089fe 100644 --- a/spec/models/debate_spec.rb +++ b/spec/models/debate_spec.rb @@ -286,6 +286,16 @@ .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] }