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
logger.info "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,
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
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?