forked from activeadmin/activeadmin
-
Notifications
You must be signed in to change notification settings - Fork 0
Testing your ActiveAdmin resources with RSpec
nhance edited this page Dec 18, 2012
·
2 revisions
ActiveAdmin comes with its own tests, so your testing can be limited to verifying the configuration of your application and resources.
This wiki is a work in progress, but can be used as a reference.
ActiveAdmin.application.namespaces[:admin].resources.should have_key("AdminUser")
For the items below, assume the following:
let(:resource_class) { YourResource }
let(:resource) { ActiveAdmin.application.namespaces[:admin].resources.find_by_class(resource_class) }
resource.resource_name.should == "YourResource"
resource.should be_include_in_menu
resource.menu.label.should == "Your Resources"
resource.defined_actions.should =~ [:create, :new, :update, :edit, :index, :show, :destroy]
resource.scope_to.should == :current_user
???