Forum: Ruby on Rails [FYI] issues with integration testing

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Chris H. (Guest)
on 2006-04-07 21:21
(Received via mailing list)
I was working on an integration test to test login/logout functionality
came across an issue that took me a bit to figure out.

In one of my controllers, I have to test the
value as a portion of the app will be access by Windows CE hand-helds.
the controllers index action i had the lines "user agent: " + request.env["HTTP_USER_AGENT"]
redirect_to :controller => "handheld", :action => "index" and return if
request.env["HTTP_USER_AGENT"] =~ /Windows CE/

my test was failing due to a 500 server status, as a 200 was expected

well, after some figuring out how to get at the response to see why I
getting a 500 status response

(i wound up doing a puts @response.body...if there is a cleaner way,
tell me)

i saw that i was getting a can't convert nil to string error in the

i removed the first line and suddenly my test worked.

after inspecting @request.env, i see there is no HTTP_USER_AGENT entry
the hash.

so this is just an FYI for those that might run across this.

and to anyone who's involved in the development of the integration test
code...should I put a ticket in for something like this?

Jamis B. (Guest)
on 2006-04-09 05:08
(Received via mailing list)

Please do submit a ticket for this. Thanks!

- Jamis
This topic is locked and can not be replied to.