summaryrefslogtreecommitdiff
path: root/spec/models/note_spec.rb
diff options
context:
space:
mode:
authorTomasz Maczukin <tomasz@maczukin.pl>2016-01-11 15:34:29 +0100
committerTomasz Maczukin <tomasz@maczukin.pl>2016-01-11 15:34:29 +0100
commita30377c6f1415a863bd40d1876e3cf4c46bb9f5d (patch)
tree338a7ae15e34d4ae65adb2717f53998e12b58f34 /spec/models/note_spec.rb
parent4e70f2519bba83d5f9d6fd0bed80e9837e8b5fc5 (diff)
parent1ede18bfa84a47ade94a0fe1acd246233db02693 (diff)
downloadgitlab-ce-a30377c6f1415a863bd40d1876e3cf4c46bb9f5d.tar.gz
Merge branch 'master' into ci/api-builds
* master: (143 commits) Only load autocomplete data when actually needed Check for current user Add pencil icon to edit group settings Issue #5817 wording of the web hooks updated on issue and merge events use JavaScript instead of CoffeeScript in Views, the reason #9819 Before project save ensure that a runners_token exists Fix Error 500 when visiting build page of project with nil runners_token Remove outdated gitlab-git-http-server reference from Install doc Fix typo in build page of projects Update docs for shared runner default settings Disable "Already Blocked" button in admin abuse report page Add CHANGELOG entry for reply-by-email fix Use WOFF versions of SourceSansPro Clean up document on adding users to a project Refactor ZenMode Fix caching issue where build status was not updating in project dashboard Add a CHANGELOG entry for The Most Important Feature of All Time(TM) changes verb `references` to noun `reference`. fixes new branch button positioning, when visible and not visible container DRY up upload and download services ...
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 }