Sha256: a1e1f7c992179eb8e64fb08e1f52339abef73e84e63b5d6b27ac26e6d91bd56f

Contents?: true

Size: 822 Bytes

Versions: 13

Compression:

Stored size: 822 Bytes

Contents

require 'spec_helper' 

module ActiveAdmin
  describe Resource, "Menu" 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 "#include_in_menu?" do
      let(:namespace){ ActiveAdmin::Namespace.new(application, :admin) }
      subject{ resource }

      context "when belongs to" do
        let(:resource){ namespace.register(Post){ belongs_to :author } }
        it { should_not be_include_in_menu }
      end

      context "when belongs to optional" do
        let(:resource){ namespace.register(Post){ belongs_to :author, :optional => true} }
        it { should be_include_in_menu }
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
activeadmin-0.5.1 spec/unit/resource/menu_spec.rb
activeadmin-0.5.0 spec/unit/resource/menu_spec.rb
activeadmin-0.5.0.pre1 spec/unit/resource/menu_spec.rb
activeadmin-0.5.0.pre spec/unit/resource/menu_spec.rb
activeadmin-0.4.4 spec/unit/resource/menu_spec.rb
activeadmin-0.4.3 spec/unit/resource/menu_spec.rb
activeadmin-0.4.2 spec/unit/resource/menu_spec.rb
activeadmin-0.4.1 spec/unit/resource/menu_spec.rb
activeadmin-0.4.0 spec/unit/resource/menu_spec.rb
andrewroth_activeadmin-0.3.4.4 spec/unit/resource/menu_spec.rb
andrewroth_activeadmin-0.3.4.3 spec/unit/resource/menu_spec.rb
andrewroth_activeadmin-0.3.4.2 spec/unit/resource/menu_spec.rb
andrewroth_activeadmin-0.3.4.1 spec/unit/resource/menu_spec.rb