How do I run an rspec test under different conditions?
I am running my rspec tests in a test environment. But I have one test that needs to use the development database. (I am running curl command with RestClient, which creates an object in the database (Photo table)). I need to check this object in a normal database.
In my spec_helper, I have ENV ["RAILS_ENV"] || = 'test'
I tried adding ENV ["RAILS_ENV"] = 'development' in this single test, but it still says Uninitialized constant Photo.
Any idea?
+3
source to share
2 answers