summaryrefslogtreecommitdiff
path: root/spec/models/note_spec.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2017-03-06 17:12:49 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2017-03-06 17:12:49 +0100
commit0e5d065848aa3149efcb5248293f265699b5b57c (patch)
tree8c9c725befc4847bf963f636a7210ac1fce3778a /spec/models/note_spec.rb
parent46d99dedfbe10dc36c79c6f09d886ad2fc2192b5 (diff)
parent348dff0a826c45f00f992e761423a22d2ac32bc3 (diff)
downloadgitlab-ce-23993-drop-ci_projects.tar.gz
Merge remote-tracking branch 'origin/master' into 23993-drop-ci_projects23993-drop-ci_projects
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