Sha256: 92c0da3c3b0aac16441fbfc272be9253f245d5545289efb77a50e5266eeb5a62
Contents?: true
Size: 1.01 KB
Versions: 1
Compression:
Stored size: 1.01 KB
Contents
require 'rails_helper' RSpec.describe ActiveAdmin::Views::Pages::Show do describe "the resource" do let(:helpers) { double resource: resource } let(:arbre_context) { Arbre::Context.new({}, helpers) } subject(:page) { ActiveAdmin::Views::Pages::Show.new(arbre_context) } context 'when the resource does not respond to #decorator' do let(:resource) { 'Test Resource' } it "normally returns the resource" do expect(page.resource).to eq 'Test Resource' end end context 'when you pass a block to main content' do let(:block) { lambda { } } let(:resource_class) { double(columns: [double('column', name: 'field')]) } let(:resource) { double('resource', class: resource_class) } before { allow(page).to receive(:active_admin_config).and_return(double(comments?: false))} it 'appends it to the output' do expect(page).to receive(:attributes_table).with(:field).and_yield page.default_main_content(&block) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
activeadmin-1.0.0.pre5 | spec/unit/views/pages/show_spec.rb |