How do I configure integration tests using rspec 2?
- by Jamie Monserrate
I need to have different settings for my unit tests and different settings for my integration tests. Example
For unit tests, I would like to do
WebMock.disable_net_connect!(:allow_localhost => true)
And for integration tests, I would like to do
WebMock.allow_net_connect!
Also, before the start of an integration test, I would like to make sure that solr is started. Hence I want to be able to call
config.before(:suite) do
SunspotStarter.start
end
BUT, only for integration tests. I do not want to start my solr if its a unit test.
How do I keep their configurations separate? Right now, I have solved this by keeping my integration tests in a folder outside the spec folder, which has its own spec_helper. Is there any better way?