How do I change the RAILS_ENV for rspec integration or remote specs?

I would like to create a set of remote specs "specs/remote" that run with the RAILS_ENV = 'remote'. These specs need to use a different database than the model specs. I would make them integration specs if that was easiest.

Ultimately, what is the easiest way change the RAILS_ENV from test and run a group of specs?

Answers


  • Create remote.rb in config/environments

  • Tell rspec to use your custom environment by setting export RAILS_ENV=remote at the shell prompt.

  • Add the remote environment to your config/database.yml with the appropriate settings for your alternate database.

Don't forget you can use YAML to include one environments configuration within another:

base: &base
  adapter: mysql

development:
  database: dev_database
  <<: *base

test:
  database: test_databae
  <<: *base

remote:
  database: remote_databae
  <<: *test

etc.


Need Your Help

iOS XCode & Code Signing

iphone ios xcode ios5 ios4

I am currently about to start work on an iOS app for somebody but they have there own Apple Developer account which they would like to us. How do I go about setting my MAC up so that I can use their

Google Maps: scroll map programmatically of x pixels

google-maps google-maps-api-3 scroll gmaps4rails

Is there a simple way to scroll a google map programmatically of x pixels?