Skip to content

Commit

Permalink
adds extra specs for debate's cache
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanxu committed Sep 6, 2015
1 parent 31b00c3 commit e706aaf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/models/debate_spec.rb
Expand Up @@ -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] }
Expand Down

0 comments on commit e706aaf

Please sign in to comment.