Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set subdomain for length of integration test on multi-site app?

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.

like image 343
kareem Avatar asked Feb 23 '09 20:02

kareem


1 Answers

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
like image 125
Olly Avatar answered Nov 03 '22 10:11

Olly