# testing with specific request env

**URL:** <https://discuss.rubyonrails.org/t/testing-with-specific-request-env/7488>\
**Category:** rubyonrails-talk\
**Created:** [January 20, 2007, 10:15am UTC](https://discuss.rubyonrails.org/t/testing-with-specific-request-env/7488 "2007-01-20T10:15:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jean\_Helou](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@Jean\_Helou](https://discuss.rubyonrails.org/u/Jean_Helou)\
**Post date:** [January 20, 2007, 10:15am UTC](https://discuss.rubyonrails.org/t/testing-with-specific-request-env/7488/1 "2007-01-20T10:15:20Z")

</div>

Hi,

I can't seem to be able to add specific headers to a ActionController::TestRequest. The controller never sees them.

I have recreated the problem in the most simple form I could

line 28 should pass right ? [http://pastie.caboo.se/34430](http://pastie.caboo.se/34430)

this works fine using the normal CGIRequest object ... 😕 but makes it hard to test controllers whose actions depend on headers which are not used by rails (such as HTTP\_ACCEPT\_LANGUAGE)

have I missed something ?

thx jean

I join a tgz with a complete and fresh rails 1.2.1 and all the necessary files to run rake test and see it fail.

[pipocontroller.tgz](https://discuss.rubyonrails.org/uploads/short-url/kNcsrZPYyZP16UQ7Q7rLoAFaHco.tgz) (53.6 KB)
