Rails: product testing

We are working on a Rails 3 project and are testing using Capybara / RSpec. The problem is that the intermediate and production environments are somewhat different. Sometimes the tests will work fine, and there will be no problems during the setup, but they will be broken.

An example is the addition of middleware that uses Rack :: File to send files. The application sent an "X-Sendfile" header, which runs under Apache, but Nginx expects an "X-Accel-Redirect".

I am looking for the best way to run a battery of tests when we get to production. Has anyone done this? Ideally, tests should not be run on the production server itself.

Tests will mainly cover the main functions of our product and will be different from the tests that we currently perform.

Thank you so much

+6
ruby-on-rails-3 testing
source share
1 answer

What I ended up with is another RSpec test suite in production_test, which has read-only access to the database. I am using the capybara-webkit driver, and each test starts by visiting the full URL for this test.

+6
source share

All Articles