Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-01-06 15:33:47 +0300
committerDouwe Maan <douwe@gitlab.com>2016-01-06 15:33:47 +0300
commit18b17072c6cc7eb199d1da34a3ea481dcd53a8cf (patch)
tree3d4f39a2a0476865cb874640d807cd5dfcb0aab4 /spec/models/note_spec.rb
parent37ce5f312eabf95deff7aac68f6bce6ba6e106b9 (diff)
Add regression test.
Diffstat (limited to 'spec/models/note_spec.rb')
-rw-r--r--spec/models/note_spec.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb
index 593d8f76215..151a29e974b 100644
--- a/spec/models/note_spec.rb
+++ b/spec/models/note_spec.rb
@@ -125,6 +125,19 @@ describe Note, models: true do
let(:set_mentionable_text) { ->(txt) { subject.note = txt } }
end
+ describe "#all_references" do
+ let!(:note1) { create(:note) }
+ let!(:note2) { create(:note) }
+
+ it "reads the rendered note body from the cache" do
+ expect(Banzai::Renderer).to receive(:render).with(note1.note, pipeline: :note, cache_key: [note1, "note"], project: note1.project)
+ expect(Banzai::Renderer).to receive(:render).with(note2.note, pipeline: :note, cache_key: [note2, "note"], project: note2.project)
+
+ note1.all_references
+ note2.all_references
+ end
+ end
+
describe :search do
let!(:note) { create(:note, note: "WoW") }
@@ -164,7 +177,7 @@ describe Note, models: true do
expect(note.editable?).to be_falsy
end
end
-
+
describe "set_award!" do
let(:issue) { create :issue }