We're working on a Rails 3 project and testing using Capybara/RSpec. The problem is that the staging and production environment differ somewhat. Sometimes, the tests will run fine and there will be no problem on staging, but will break in production.
An example is when we added a middleware that uses Rack::File to send files. The application sent the header 'X-Sendfile' which works under Apache but Nginx expects 'X-Accel-Redirect'.
I'm looking for the best way to run a battery of tests when we push to production. Has anyone done this? Ideally the tests should not be run on the production server itself.
The tests would basically cover the core features of our product and would be different from the tests we are currently running.
Thanks a lot
What I ended up doing is have another set of RSpec test in a production_test environment that has read-only access to the database. I use the capybara-webkit driver and each test starts by visiting the complete URL for that test.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With