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 case this helps anyone in future, it was database connection issue (Postgresql in my case). Head over to config/database.yml file and supply username: and password: < default is toor>
config/database.yml
username:
password:
Add this in the development: group.
development: