i’ve a functional and customized rails admin installation on my app and in order to secure everything is working as it should, i want to do some tests for it
I’m trying to accomplish something like this
require 'spec_helper'
describe RailsAdmin::MainController do
render_views
let(:admin) { FactoryGirl.create(:admin_user) }
describe "should manage a dashboard" do
before :each do
sign_in admin
end
it "should render dashboard" do
get :dashboard
response.should be_success
end
end
end
this was working time ago but suddenly every time run the spec i receive this error
Failure/Error: get :dashboard
ActionController::RoutingError:
No route matches {:controller=>"rails_admin/main", :action=>"dashboard"}
here is a copy of my spec helper
https://gist.github.com/3173172
I believe that testing this stuff in controller specs (in fact unit tests for controller) is a bad idea. Request spec would be a better place.
You could check my example project: https://github.com/lucassus/locomotive/blob/master/spec/requests/admin/manage_users_spec.rb here you have sample request spec for active_admin user section customization.