[rspec-users] Testing Sub-domains with Cucumber

Jonathan Linowes jonathan at parkerhill.com
Wed Jan 14 09:45:42 EST 2009


On Jan 13, 2009, at 8:46 PM, Tom Hoen wrote:

> My site uses sub-domains to create a context for the user. In my  
> tests,
> I need to stipulate what domain is being used, to test whether the
> context is correct for the given user.
>
> But I cannot find if and where i can change the request.host value, if
> indeed, that is what I need to change.
>
> When I say 'visits "/login"' in a step, I want it to have know to  
> go to
> harvey.localhost:3000 for this feature/scenario. In another
> feature/scenario, I will want it to go to humbel.localhost:3000 etc.
>
> What would you suggest.
>
> All the best,
> Tom
> -- 
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users


I do:

host! "#{account.to_param}.example.com"

--linoj



More information about the rspec-users mailing list