diff options
author | Tiago Botelho <tiagonbotelho@hotmail.com> | 2017-08-23 19:53:29 +0300 |
---|---|---|
committer | Tiago Botelho <tiagonbotelho@hotmail.com> | 2017-09-06 17:35:35 +0300 |
commit | 6d8e102c740b75ac9e1d168a84f532f6d9ebaa65 (patch) | |
tree | 803818e401c0f99a54c41776c5b8dec2c38fd9c0 /spec/lib/banzai/commit_renderer_spec.rb | |
parent | dd7434e398d26e5f4c92f73dce4bcf9b7e47e193 (diff) |
Adds cacheless render to Banzai object render
Diffstat (limited to 'spec/lib/banzai/commit_renderer_spec.rb')
-rw-r--r-- | spec/lib/banzai/commit_renderer_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/lib/banzai/commit_renderer_spec.rb b/spec/lib/banzai/commit_renderer_spec.rb new file mode 100644 index 00000000000..049d025a5b9 --- /dev/null +++ b/spec/lib/banzai/commit_renderer_spec.rb @@ -0,0 +1,19 @@ +require 'spec_helper' + +describe Banzai::CommitRenderer do + describe '.render' do + it 'renders a commit description and title' do + user = double(:user) + 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 + expect(Banzai::Renderer).to receive(:cacheless_render_field).with(project.commit, attr) + end + + described_class.render([project.commit], project, user) + end + end +end |