Sha256: 186679f85cbca17c6efde2b71f0f6de35e4c746958a4716fc6083526d8948d2e

Contents?: true

Size: 1.14 KB

Versions: 9

Compression:

Stored size: 1.14 KB

Contents

require 'spec_helper'

describe ActiveAdmin::Application do
  let(:application){ ActiveAdmin::Application.new }
  let(:controllers){ [ActiveAdmin::BaseController,            ActiveAdmin::Devise::SessionsController,
                      ActiveAdmin::Devise::UnlocksController, ActiveAdmin::Devise::PasswordsController] }

  it 'before_filter' do
    controllers.each{ |c| c.should_receive(:before_filter).and_return(true) }
    application.before_filter :my_filter, :only => :show
  end

  it 'skip_before_filter' do
    controllers.each{ |c| c.should_receive(:skip_before_filter).and_return(true) }
    application.skip_before_filter :my_filter, :only => :show
  end

  it 'after_filter' do
    controllers.each{ |c| c.should_receive(:after_filter).and_return(true) }
    application.after_filter :my_filter, :only => :show
  end

  it 'around_filter' do
    controllers.each{ |c| c.should_receive(:around_filter).and_return(true) }
    application.around_filter :my_filter, :only => :show
  end
  
  it 'skip_filter' do
    controllers.each{ |c| c.should_receive(:skip_filter).and_return(true) }
    application.skip_filter :my_filter, :only => :show
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
activeadmin-0.6.4 spec/unit/controller_filters_spec.rb
yousty-activeadmin-1.0.4.pre spec/unit/controller_filters_spec.rb
yousty-activeadmin-1.0.3.pre spec/unit/controller_filters_spec.rb
yousty-activeadmin-1.0.2.pre spec/unit/controller_filters_spec.rb
activeadmin-0.6.3 spec/unit/controller_filters_spec.rb
yousty-activeadmin-1.0.1.pre spec/unit/controller_filters_spec.rb
yousty-activeadmin-1.0.0.pre spec/unit/controller_filters_spec.rb
activeadmin-0.6.2 spec/unit/controller_filters_spec.rb
activeadmin-0.6.1 spec/unit/controller_filters_spec.rb