I recently upgraded to Rails 5.1 from v4.3 and am now getting this error when running tests:
An error occurred while loading ./spec/controllers/admin/capac
In my case recent rails_admin required some addition
RuntimeError: Required middlewares for RailsAdmin are not added To fix tihs, add config.middleware.use ActionDispatch::Flash to config/application.rb.
RuntimeError: Required middlewares for RailsAdmin are not added To fix tihs, add
config.middleware.use ActionDispatch::Flash
to config/application.rb.
Then all rspecs became green again.