debian-mirror-gitlab/spec/models/blob_viewer/markup_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
740 B
Ruby
Raw Permalink Normal View History

2021-01-03 14:25:43 +05:30
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe BlobViewer::Markup do
include FakeBlobHelpers
let(:project) { create(:project, :repository) }
let(:blob) { fake_blob(path: 'CHANGELOG.md') }
subject { described_class.new(blob) }
describe '#banzai_render_context' do
it 'returns context needed for banzai rendering' do
expect(subject.banzai_render_context.keys).to eq([:cache_key])
end
context 'when blob does respond to rendered_markup' do
before do
allow(blob).to receive(:rendered_markup).and_return("some rendered markup")
end
it 'does sets rendered key' do
expect(subject.banzai_render_context.keys).to include(:rendered)
end
end
end
end