BigW Consortium Gitlab

note_renderer_spec.rb 620 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
require 'spec_helper'

describe Banzai::NoteRenderer do
  describe '.render' do
    it 'renders a Note' do
      note = double(:note)
      project = double(:project)
      wiki = double(:wiki)
      user = double(:user)

      expect(Banzai::ObjectRenderer).to receive(:new).
        with(project, user,
             requested_path: 'foo',
             project_wiki: wiki,
15
             ref: 'bar').
16 17 18 19 20 21 22 23 24
        and_call_original

      expect_any_instance_of(Banzai::ObjectRenderer).
        to receive(:render).with([note], :note)

      described_class.render([note], project, user, 'foo', wiki, 'bar')
    end
  end
end