Sha256: e93588a4e0787456ffa12b7c469636410c7826cb381c1afbde7a4cf813a3be86
Contents?: true
Size: 895 Bytes
Versions: 20
Compression:
Stored size: 895 Bytes
Contents
require 'rails_helper' RSpec.describe ActiveAdmin::ResourceController::Sidebars, type: :controller do let(:klass){ Admin::PostsController } shared_context 'with post config' do before do load_resources { post_config } @controller = klass.new get :index end end context 'without skip_sidebar! before filter' do include_context 'with post config' do let(:post_config) { ActiveAdmin.register Post } end it 'does not set @skip_sidebar' do expect(controller.instance_variable_get(:@skip_sidebar)).to eq nil end end context 'with skip_sidebar! before_action' do include_context 'with post config' do let(:post_config) do ActiveAdmin.register(Post) { before_action :skip_sidebar! } end end it 'works' do expect(controller.instance_variable_get(:@skip_sidebar)).to eq true end end end
Version data entries
20 entries across 20 versions & 4 rubygems