After setting a subdomain via suddomain_fu, you may find that WebRat reports “You are being redirected”, which might not be what you want. WebRat expects to run tests against the domain “example.com” and it doesn’t want tests to redirect outside of the test domain.

The solution is to create a step to change the subdomain:

1 Given /^we're on the subdomain "(.+?)"$/ do |subdomain|
2   host! "#{subdomain}.example.com"
3 end
blog comments powered by Disqus