adds touch to debates on tag destroy

This commit is contained in:
Juanjo Bazán
2015-08-31 20:26:30 +02:00
parent 358f8cc392
commit a00abc0020
2 changed files with 21 additions and 0 deletions

14
spec/lib/cache_spec.rb Normal file
View File

@@ -0,0 +1,14 @@
require 'rails_helper'
describe 'Cache flow' do
describe 'Tag destroy' do
it 'invalidates Debate cache keys' do
debate = create(:debate, tag_list: "Good, Bad")
tag = ActsAsTaggableOn::Tag.find_by(name: "Bad")
expect{tag.destroy}.to change {debate.reload.cache_key}
end
end
end