Hi,

On 25 Wrz, 21:02, Fernando Perez <[EMAIL PROTECTED]>
wrote:
> My app, relies on request.domain to display some data according to the
> domain.
>
> However during RSpec tests, the request.domain is set to "test.host". Is
> there a way I can manually set it for the test environment?

Yes, you can do that, for example I do it like this:

   it "should do something"
     request.headers["Host"] = "microsoft.com"
     get :index
     response.should render_template("public/404.html")
     response.headers["Status"].should == "404 Not Found"
   end

Not all is required, but you get the idea ;).

> Thanks for your tip
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to