spec/unit/resource_registration_spec.rb in activeadmin-0.4.4 vs spec/unit/resource_registration_spec.rb in activeadmin-0.5.0.pre
- old
+ new
@@ -24,15 +24,11 @@
application.namespaces[namespace.name] = namespace
namespace.should_receive(:register)
application.register Category, :namespace => :hello_world
end
- it "should generate a menu item for the dashboard" do
- application.register Category, :namespace => :hello_world
- application.namespaces[:hello_world].load_menu!
- application.namespaces[:hello_world].menu['Dashboard'].instance_variable_get("@url").should == :hello_world_dashboard_path
- end
+
it "should generate a Namespace::RegisterEvent and a Resource::RegisterEvent" do
ActiveAdmin::Event.should_receive(:dispatch).with(ActiveAdmin::Namespace::RegisterEvent, an_instance_of(ActiveAdmin::Namespace))
ActiveAdmin::Event.should_receive(:dispatch).with(ActiveAdmin::Resource::RegisterEvent, an_instance_of(ActiveAdmin::Resource))
application.register Category, :namespace => :not_yet_created
end
@@ -44,24 +40,17 @@
application.namespaces[namespace.name] = namespace
namespace.should_receive(:register)
application.register Category, :namespace => false
end
-
- it "should generate a menu item for the dashboard" do
- application.register Category, :namespace => false
- application.namespaces[:root].load_menu!
- application.namespaces[:root].menu['Dashboard'].instance_variable_get("@url").should == :dashboard_path
- end
-
end
context "when being registered multiple times" do
it "should run the dsl in the same config object" do
config_1 = ActiveAdmin.register(Category) { filter :name }
config_2 = ActiveAdmin.register(Category) { filter :id }
config_1.should == config_2
- config_1.controller.filters_config.size.should == 2
+ config_1.filters.size.should == 2
end
context "with different resource classes" do
it "should raise an ActiveAdmin::ResourceMismatch" do
lambda {