
current_url does not reflect redirects in a Mechanize session
Reported by Bryan Helmkamp | January 17th, 2010 @ 06:44 PM
Moved from GitHub issue # 17
Created 4 months ago by sandro | edit
When I visit a protected page within a mechanize session and it
redirects me to the sign in page, the current_url still points to
the protected url, not the url of the redirect. I assume this
happens because mechanize follows redirects by default.
A possible solution:
module Webrat
class MechanizeSession
def current_url
response.uri.to_s
end
end
class Session
def current_url
if @adapter.respond_to?(:current_url)
@adapter.current_url
else
@current_url
end
end
end
end
Comments
piglop September 19, 2009
It works, but with "class MechanizeAdapter". instead of "class MechanizeSession"
Comments and changes to this ticket
-
Bryan Helmkamp April 13th, 2010 @ 11:05 AM
- State changed from new to resolved
(from [2a6c67b17bc3412a68a0df6f94ff2308726b3a59]) Fix delegation of
response_headers
method.[#332 state:resolved] http://github.com/brynary/webrat/commit/2a6c67b17bc3412a68a0df6f94f...
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.
People watching this ticket
Attachments
Referenced by
-
332 current_url does not reflect redirects in a Mechanize session [#332 state:resolved] http://github.com/brynary/webrat/c...