2017-08-23 12:53:29 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Banzai::CommitRenderer do
|
|
|
|
describe '.render' do
|
|
|
|
it 'renders a commit description and title' do
|
2017-12-11 09:21:06 -05:00
|
|
|
user = build(:user)
|
2017-08-23 12:53:29 -04:00
|
|
|
project = create(:project, :repository)
|
|
|
|
|
|
|
|
expect(Banzai::ObjectRenderer).to receive(:new).with(project, user).and_call_original
|
|
|
|
|
|
|
|
described_class::ATTRIBUTES.each do |attr|
|
|
|
|
expect_any_instance_of(Banzai::ObjectRenderer).to receive(:render).with([project.commit], attr).once.and_call_original
|
2017-11-06 11:52:56 -05:00
|
|
|
expect(Banzai::Renderer).to receive(:cacheless_render_field).with(project.commit, attr, {})
|
2017-08-23 12:53:29 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
described_class.render([project.commit], project, user)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|