#329 new
Bryan Helmkamp

Webrat does not remember the hostname thus does not follows redirects.

Reported by Bryan Helmkamp | January 17th, 2010 @ 06:40 PM

Moved from GitHub issue # 13

Created 4 months ago by 3scale

I'm in a webrat session. I do something like visit "http://foo.com/something". So now I'm on the "foo.com" hostname. Now I do click_button("Whatever"). If the result of this action is redirect, it won't be followed, because webrat thinks it's an external redirect. That's because it does not remembers that it is on "foo.com", but uses the hardcoded default "www.example.com".

The reason why this matters is, that you may want to test an application which has logic which depends on the domain/subdomain it is accessed on (for example with the subdomain_fu plugin).

Comments

atmos August 21, 2009

We have the same problem. We work around it manually now but we would love to see this in webrat proper.

3scale September 02, 2009

The workaround is, in your tests, to use only domains which are subdomains of example.com (foo.example.com, bar.example.com). This works for us for now, but may not work for someone else. It would be much better if this problem is properly solved.

varandasi September 22, 2009

I have the same problem, it worked in older versions...

michelefranzin November 06, 2009

same issue :-(

sickill November 13, 2009

Yeah, same issue here. Real pain in the ass. Maybe some webrat monkey-patching could work temporarily as a workaround....

pivotal December 09, 2009

Also encountered this problem. Should be trivial to make the test host settable? And why not use test.host?

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.

New-ticket Create new ticket

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.

Shared Ticket Bins

People watching this ticket

Pages