2016-08-24 12:49:21 +05:30
|
|
|
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-09-10 17:25:29 +05:30
|
|
|
expect(Banzai::ObjectRenderer).to receive(:new)
|
|
|
|
.with(project, user,
|
2016-08-24 12:49:21 +05:30
|
|
|
requested_path: 'foo',
|
|
|
|
project_wiki: wiki,
|
2017-09-10 17:25:29 +05:30
|
|
|
ref: 'bar')
|
|
|
|
.and_call_original
|
2016-08-24 12:49:21 +05:30
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
expect_any_instance_of(Banzai::ObjectRenderer)
|
|
|
|
.to receive(:render).with([note], :note)
|
2016-08-24 12:49:21 +05:30
|
|
|
|
|
|
|
described_class.render([note], project, user, 'foo', wiki, 'bar')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|