method

env

rails latest stable - Class: ActionController::AbstractRequest

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v1.0.0) is shown here.

env()
public

Returns the hash of environment variables for this request, such as { ‘RAILS_ENV’ => ‘production’ }.

1Note

you probably want:

taryneast ยท Jan 24, 2011

Rails.env

or possibly:

ActionController::TestRequest.new (which has a demo of how to set env vars on a controller test)