Rails test across multiple environments

Posted by DSimon on Stack Overflow See other posts from Stack Overflow or by DSimon
Published on 2010-05-26T16:45:49Z Indexed on 2010/05/26 17:51 UTC
Read the original article Hit count: 180

Is there some way to change Rails environments mid-way through a test? Or, alternately, what would be the right way to set up a test suite that can start up Rails in one environment, run the first half of my test in it, then restart Rails in another environment to finish the test? The two environments have separate databases.

Some necessary context: I'm writing a Rails plugin that allows multiple installations of a Rails app to communicate with each other with user assistance, so that a user without Internet access can still use the app. They'll run a local version of an app, and upload their work to the online app by saving a file to a thumbdrive and taking it to an Internet cafe.

The plugin adds two special environments to Rails: "offline-production" and "offline-test". I want to write functional tests that involve both the "test" and "offline-test" environments, to represent the main online version of the app and the local offline version of the app respectively.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby