Capybara page.has_content? does not work in Cucumber tests

Problem

You are trying to use page.has_content? inside a cucumber step definition, but it doesn’t work as it matches all text, and returns always true.

Solution

Change the page.has_content? to page.should have_content instead and the tests should be failing when the text doesn’t match.

Cucumber testing and ssl

Problem

Your application is ussing force_ssl to redirect all calls to ‘https’, but when you try to use your cucumber tests they fail.

Solution

By using the suggestion here, you can add a file in your initializers to bypass the ssl in development and test environment as follows:

deploy:assets:precompile insists on running on production environment in capistrano

Problem
You want to deploy your rails 3.2 application to another environment except production, but the default capistrano recipe for precompiling the assets keeps using the production environment as in:

Solution
Add the following environment option in your deploy/other_env.rb file: