Sha256: a446be842ee20387b1cfd263d9480965fc399303b2366407117333ab0bb8d5e4
Contents?: true
Size: 1.12 KB
Versions: 59
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
59 entries across 59 versions & 3 rubygems