Sha256: 5f44bc52e55ae686ea3230cb75b84d343dd27550c4843148a9508db84b5b26ef

Contents?: true

Size: 914 Bytes

Versions: 4

Compression:

Stored size: 914 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') 

describe ActiveAdmin, "filters" do

  describe "before filters" do
    it "should add a new before filter to ActiveAdmin::ResourceController" do
      ActiveAdmin::ResourceController.should_receive(:before_filter).and_return(true)
      ActiveAdmin.before_filter :my_filter, :only => :show
    end
  end

  describe "after filters" do
    it "should add a new after filter to ActiveAdmin::ResourceController" do
      ActiveAdmin::ResourceController.should_receive(:after_filter).and_return(true)
      ActiveAdmin.after_filter :my_filter, :only => :show
    end
  end

  describe "around filters" do
    it "should add a new around filter to ActiveAdmin::ResourceController" do
      ActiveAdmin::ResourceController.should_receive(:around_filter).and_return(true)
      ActiveAdmin.around_filter :my_filter, :only => :show
    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
activeadmin-0.2.1 spec/unit/controller_filters_spec.rb
activeadmin-0.2.0 spec/unit/controller_filters_spec.rb
activeadmin-0.1.1 spec/unit/controller_filters_spec.rb
activeadmin-0.1.0 spec/unit/controller_filters_spec.rb