
Webrat doesn't work well with Metal headers
Reported by Bryan Helmkamp | January 17th, 2010 @ 06:34 PM
Copied from GitHub issue # 1
Created 8 months ago by cgunnels
We've come across an issue where webrat won't follow a redirect coming from Metal. If you run a cucumber feature to test a link and have that link run through metal, then have the metal change the headers and do a 301,302, or a 303 redirect, the feature will fail. We don't know exactly why webrat won't follow the redirect, but it won't.
headers.merge!({"Location" => "http://someurl.com"})
[303, headers, ["redirecting ..."]]
Comments
atmos August 21, 2009
We're using it with lots of straight up rack apps and not seeing this issue. What does your response(including headers) look like?
thoughtless November 20, 2009
I don't have a full answer, but I might be able to provide a little bit more info...
It seems that response.headers["Location"] is returning nil because the rack header hash is downcasing "Location". However the actual header is stored as "Location" (somehow it didn't get downcased when it was stored).
I found this when using webrat 0.5.3 and rails 2.3.2
thoughtless November 21, 2009
This seems to be a fix: http://conceptspace.wikidot.com/blog:45
I haven't investigated enough to know if this should be added to
rack or if it should be added to webrat. I guess somewhere the
response headers are being "replaced" and the
Rack::Utils::HeaderHash doesn't properly downcase the keys when
that happens.
No comments found
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Ruby Acceptance Testing for Web applications.