Created
February 2, 2012 19:55
-
-
Save henrik/1725404 to your computer and use it in GitHub Desktop.
Stubbing Rails environment in tests.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.stub!(:env).and_return(ActiveSupport::StringInquirer.new("production")) |
Yes indeed! More here: https://stackoverflow.com/questions/4266497/change-rails-environment-in-the-mid-of-testing
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For anyone else who stumbles on this via Google search, here's a less verbose way: