summaryrefslogtreecommitdiff
path: root/spec/models/note_spec.rb
diff options
context:
space:
mode:
authorAdam Niedzielski <adamsunday@gmail.com>2017-02-08 18:04:16 +0100
committerAdam Niedzielski <adamsunday@gmail.com>2017-03-01 16:48:02 +0100
commitc661df356156240deeef7c2734670ba5f2b4b04b (patch)
tree26916ddd7277ac1b5a11d8d3a0433204a97b8ec4 /spec/models/note_spec.rb
parent61c9604721dbda53eb4a7111d16c1b19292f9766 (diff)
downloadgitlab-ce-c661df356156240deeef7c2734670ba5f2b4b04b.tar.gz
Invalidate ETag cache when note changes
Diffstat (limited to 'spec/models/note_spec.rb')
-rw-r--r--spec/models/note_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb
index 1cde9e04951..33536487c41 100644
--- a/spec/models/note_spec.rb
+++ b/spec/models/note_spec.rb
@@ -387,4 +387,16 @@ describe Note, models: true do
end
end
end
+
+ describe 'expiring ETag cache' do
+ let(:note) { build(:note_on_issue) }
+
+ it "expires cache for note's issue when note is saved" do
+ 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")
+
+ note.save!
+ end
+ end
end