# Set server-side environment variables in integration testing

**URL:** <https://www.ruby-forum.com/t/set-server-side-environment-variables-in-integration-testing/190402>\
**Category:** Rails\
**Created:** [June 19, 2010, 8:43am UTC](https://www.ruby-forum.com/t/set-server-side-environment-variables-in-integration-testing/190402 "2010-06-19T08:43:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ranchlan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecb155/32.png) [@ranchlan](https://www.ruby-forum.com/u/ranchlan)\
**Post date:** [June 19, 2010, 8:43am UTC](https://www.ruby-forum.com/t/set-server-side-environment-variables-in-integration-testing/190402/1 "2010-06-19T08:43:45Z")

</div>

My Rails application uses the SERVER\_NAME environment variable to  
decide how to display some of the web pages.

I want to do integration testing with this application but I do not  
see how to force the request object’s environment variable SERVER\_NAME  
to a particular value.

I would like to do something like this in the integration test file

request.env[“SERVER\_NAME”] = “[www.example.com](http://www.example.com)”

This does not work. Any suggestions?
