Sha256: a5cacb424872cd0c48e080f3b99899a8e53179375fe1dc54c4e12bc6efc69f42

Contents?: true

Size: 723 Bytes

Versions: 7

Compression:

Stored size: 723 Bytes

Contents

require 'spec_helper' 

module ActiveAdmin
  describe Resource, "Scopes" do

    before { load_defaults! }

    let(:application){ ActiveAdmin::Application.new }
    let(:namespace){ Namespace.new(application, :admin) }

    def config(options = {})
      @config ||= Resource.new(namespace, Category, options)
    end

    describe "adding a scope" do

      it "should add a scope" do
        config.scope :published
        config.scopes.first.should be_a(ActiveAdmin::Scope)
        config.scopes.first.name.should == "Published"
      end

      it "should retrive a scope by its id" do
        config.scope :published
        config.get_scope_by_id(:published).name.should == "Published"
      end

    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
andrewroth_activeadmin-0.3.4 spec/unit/resource/scopes_spec.rb
activeadmin-0.3.4 spec/unit/resource/scopes_spec.rb
activeadmin-0.3.3 spec/unit/resource/scopes_spec.rb
activeadmin-0.3.2 spec/unit/resource/scopes_spec.rb
activeadmin-0.3.1 spec/unit/resource/scopes_spec.rb
activeadmin-0.3.0 spec/unit/resource/scopes_spec.rb
nsm-activeadmin-0.2.2 spec/unit/resource/scopes_spec.rb