Sha256: 75fbdaf97f1f71ac5b5f56f9119dffc3ed7b0fda15856fcea26bbff0ffdeef74
Contents?: true
Size: 1.12 KB
Versions: 12
Compression:
Stored size: 1.12 KB
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 it "should not add a scope with the same name twice" do config.scope :published config.scope :published config.scopes.size.should == 1 end it "should update a scope with the same id" do config.scope :published config.scopes.first.scope_block.should be_nil config.scope(:published){ } config.scopes.first.scope_block.should_not be_nil end end end end
Version data entries
12 entries across 12 versions & 3 rubygems