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
Try to run redis and sidekiq on background. In my case it was one of reasons.