features/step_definitions/configuration_steps.rb in activeadmin-0.6.6 vs features/step_definitions/configuration_steps.rb in activeadmin-1.0.0.pre1
- old
+ new
@@ -2,11 +2,11 @@
def load_aa_config(config_content)
ActiveAdmin::Event.dispatch ActiveAdmin::Application::BeforeLoadEvent, ActiveAdmin.application
eval(config_content)
ActiveAdmin::Event.dispatch ActiveAdmin::Application::AfterLoadEvent, ActiveAdmin.application
Rails.application.reload_routes!
- ActiveAdmin.application.namespaces.values.each &:reset_menu!
+ ActiveAdmin.application.namespaces.each &:reset_menu!
end
end
module ActiveAdminContentsRollback
def files
@@ -56,10 +56,17 @@
load_aa_config(config_content)
case action
when 'index'
step 'I am logged in'
- step 'I am on the index page for posts'
+ case resource = config_content.match(/ActiveAdmin\.register (\w+)/)[1]
+ when 'Post'
+ step 'I am on the index page for posts'
+ when 'Category'
+ step 'I am on the index page for categories'
+ else
+ raise "#{resource} is not supported"
+ end
when 'show'
case resource = config_content.match(/ActiveAdmin\.register (\w+)/)[1]
when 'Post'
step 'I am logged in'
step 'I am on the index page for posts'