Sha256: 1cc6d57376fdb23d14862a421acbd05515c000c2c19e6128be967acaf9e19b82

Contents?: true

Size: 1.12 KB

Versions: 9

Compression:

Stored size: 1.12 KB

Contents

require 'spec_helper' 

describe ActiveAdmin::Namespace do

  let(:application){ ActiveAdmin::Application.new }

  context "when new" do
    let(:namespace){ ActiveAdmin::Namespace.new(application, :admin) }

    it "should have an application instance" do
      namespace.application.should == application
    end

    it "should have a name" do
      namespace.name.should == :admin
    end

    it "should have no resources" do
      namespace.resources.resources.should be_empty
    end

    it "should have an empty menu" do
      namespace.menu.items.should be_empty
    end
  end # context "when new"

  describe "settings" do
    let(:namespace){ ActiveAdmin::Namespace.new(application, :admin) }

    it "should inherit the site title from the application" do
      ActiveAdmin::Namespace.setting :site_title, "Not the Same"
      namespace.site_title.should == application.site_title
    end

    it "should be able to override the site title" do
      namespace.site_title.should == application.site_title
      namespace.site_title = "My Site Title"
      namespace.site_title.should_not == application.site_title
    end
  end

end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
activeadmin-0.4.4 spec/unit/namespace_spec.rb
activeadmin-0.4.3 spec/unit/namespace_spec.rb
activeadmin-0.4.2 spec/unit/namespace_spec.rb
activeadmin-0.4.1 spec/unit/namespace_spec.rb
activeadmin-0.4.0 spec/unit/namespace_spec.rb
andrewroth_activeadmin-0.3.4.4 spec/unit/namespace_spec.rb
andrewroth_activeadmin-0.3.4.3 spec/unit/namespace_spec.rb
andrewroth_activeadmin-0.3.4.2 spec/unit/namespace_spec.rb
andrewroth_activeadmin-0.3.4.1 spec/unit/namespace_spec.rb