gitlab-org--gitlab-foss/spec/lib/banzai/note_renderer_spec.rb

25 lines
620 B
Ruby
Raw Normal View History

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)
2017-06-21 09:48:12 -04:00
expect(Banzai::ObjectRenderer).to receive(:new)
.with(project, user,
requested_path: 'foo',
project_wiki: wiki,
2017-06-21 09:48:12 -04:00
ref: 'bar')
.and_call_original
2017-06-21 09:48:12 -04:00
expect_any_instance_of(Banzai::ObjectRenderer)
.to receive(:render).with([note], :note)
described_class.render([note], project, user, 'foo', wiki, 'bar')
end
end
end