Add regression test.
This commit is contained in:
parent
37ce5f312e
commit
18b17072c6
1 changed files with 14 additions and 1 deletions
|
@ -125,6 +125,19 @@ describe Note, models: true do
|
||||||
let(:set_mentionable_text) { ->(txt) { subject.note = txt } }
|
let(:set_mentionable_text) { ->(txt) { subject.note = txt } }
|
||||||
end
|
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
|
describe :search do
|
||||||
let!(:note) { create(:note, note: "WoW") }
|
let!(:note) { create(:note, note: "WoW") }
|
||||||
|
|
||||||
|
@ -164,7 +177,7 @@ describe Note, models: true do
|
||||||
expect(note.editable?).to be_falsy
|
expect(note.editable?).to be_falsy
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "set_award!" do
|
describe "set_award!" do
|
||||||
let(:issue) { create :issue }
|
let(:issue) { create :issue }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue