spec/unit/resource_registration_spec.rb in activeadmin-1.0.0.pre4 vs spec/unit/resource_registration_spec.rb in activeadmin-1.0.0.pre5

- old
+ new

@@ -1,20 +1,25 @@ require 'rails_helper' -describe "Registering an object to administer" do - application = ActiveAdmin::Application.new +RSpec.describe "Registering an object to administer" do + let(:application) { ActiveAdmin::Application.new } context "with no configuration" do - namespace = ActiveAdmin::Namespace.new(application, :admin) - it "should call register on the namespace" do + let(:namespace) { ActiveAdmin::Namespace.new(application, :admin) } + + before do application.namespaces[namespace.name] = namespace + end + + it "should call register on the namespace" do expect(namespace).to receive(:register) application.register Category end it "should dispatch a Resource::RegisterEvent" do expect(ActiveSupport::Notifications).to receive(:publish).with(ActiveAdmin::Resource::RegisterEvent, an_instance_of(ActiveAdmin::Resource)) + application.register Category end end context "with a different namespace" do