adds extra specs for debate's cache

This commit is contained in:
Juanjo Bazán
2015-09-06 12:40:13 +02:00
parent 31b00c32f4
commit e706aaff2c

View File

@@ -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] }