diff options
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 |