How do I change the default "www.example.com" domain for testing in rails?

Posted by Denis Hennessy on Stack Overflow See other posts from Stack Overflow or by Denis Hennessy
Published on 2009-03-01T00:05:41Z Indexed on 2010/06/18 3:33 UTC
Read the original article Hit count: 224

Filed under:
|

I have a rails application which acts differently depending on what domain it's accessed at (for example www.myapp.com will invoke differently to user.myapp.com). In production use this all works fine but my test code always sees a hostname of "www.example.com".

Is there a clean way of having a test specify the hostname it's pretending to access?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about rspec