views:

191

answers:

1

what's the best way to change a subdomains for the duration of an integration test?

jamis buck suggested using host! here: http://weblog.jamisbuck.org/2006/3/9/integration-testing-in-rails-1-1#12

but according to the rails API, host! only changes the host for the following single request. i'm looking for something like @request.host in a functional test, which lets me use the subdomain for the entire test.

+2  A: 

I'm using host! in my integration tests without a problem. I generally call it once in the setup method, e.g.

def setup
    host! "my.host"    
end
Olly
thanks. i was running into an unrelated error - host! works.
kareem