# Testing a production environment

**URL:** <https://www.ruby-forum.com/t/testing-a-production-environment/152148>\
**Category:** Rails\
**Created:** [October 30, 2008, 3:41pm UTC](https://www.ruby-forum.com/t/testing-a-production-environment/152148 "2008-10-30T15:41:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [October 30, 2008, 3:41pm UTC](https://www.ruby-forum.com/t/testing-a-production-environment/152148/1 "2008-10-30T15:41:40Z")

</div>

In one place in my views I do something different if I’m in production  
rather than development or test. How do I test that? I need to change  
the environment for just that one test but I can’t set RAILS\_ENV as  
that’s a global constant and Ruby complains.

Thanks

John S.
