I'm working in Docker, trying to run bundle exec rspec ./spec/services/something/something_spec.rb
and I am getting this error
DatabaseCleaner::Safeguard::Error::RemoteDatabaseUrl:
ENV['DATABASE_URL'] is set to a remote URL
Tried a couple of thing but so far nothing was helping
My initial around was to just temporarily comment out DatabaseCleaner
use in spec/rails_helper.rb
so I could run the test locally in development environment but that wasn't great.
Then I after reading for a while I found a better solution, tried this
config.before(:suite) do
DatabaseCleaner.allow_remote_database_url = true
end
And it worked. Hope that helps!