diff options
author | mhasbini <mohammad.hasbini@gmail.com> | 2017-04-11 15:20:25 +0300 |
---|---|---|
committer | mhasbini <mohammad.hasbini@gmail.com> | 2017-04-11 15:20:25 +0300 |
commit | f1f9578f1c95ca6fb60d45b60ace42638980adb5 (patch) | |
tree | 14b37f0793dfc145d9ec4bd594d3237283bcadda /spec/models/note_spec.rb | |
parent | 9c576cc7e9414e64b4aac0544615e7d5e92c3558 (diff) | |
download | gitlab-ce-f1f9578f1c95ca6fb60d45b60ace42638980adb5.tar.gz |
Fix issue's note cache expiration after delete
Diffstat (limited to 'spec/models/note_spec.rb')
-rw-r--r-- | spec/models/note_spec.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb index 3c4bf3f4ddb..557ea97b008 100644 --- a/spec/models/note_spec.rb +++ b/spec/models/note_spec.rb @@ -622,12 +622,22 @@ describe Note, models: true do describe 'expiring ETag cache' do let(:note) { build(:note_on_issue) } - it "expires cache for note's issue when note is saved" do + def expect_expiration(note) expect_any_instance_of(Gitlab::EtagCaching::Store) .to receive(:touch) .with("/#{note.project.namespace.to_param}/#{note.project.to_param}/noteable/issue/#{note.noteable.id}/notes") + end + + it "expires cache for note's issue when note is saved" do + expect_expiration(note) note.save! end + + it "expires cache for note's issue when note is destroyed" do + expect_expiration(note) + + note.destroy! + end end end |