In my Rails application, I access the env hash in one of my controller actions.
Something along the lines of:
def my_before_filter env['some.key'] = "Something or other" end
This is great for my requirements.
If I run the Rails application in a test environment and run an action like:
# /users in UsersController
Then the contents of the env hash are output to the console as expected.
When I get this action from the RSPec example, is the output an empty hash?
it 'should get the index action' do get :index end .....{}....
Why is env hash empty?
I created a dummy rails app to show this
bodacious
source share