I\'m using Rspec for testing. However, it uses my development DB instead of my test DB. How can this occur?
I simply use rspec to run my tests: don:my_project_root
Relates to Rails 4.2.1 which is the latest stable version as of this post
Im still trying to solve this. However as a "stop-gap" you can prepend your rspec commands with an environment declaration "RAILS_ENV=test".
For example: to run a test you would write:
RAILS_ENV=test rspec path/to/test_spec.rb
You could alias rspec as "RAILS_ENV=test rspec" but that would just be hiding the problem and as such I personally haven't done this ... yet.
Ill be sure to update this thread with a solution as soon as I find one as none of the above as helped me at all.