DEfusion
2010-Sep-06 09:37 UTC
[rspec-users] How can I set the host for testing subdomain constrained routes in RSpec 2?
I''ve tried: host = ''foo.bar.com'' host! (undefined method) request.host (request undefined) controller.request.host (controller undefined) @controller.request.host (undefined method `request'' for nil:NilClass)
David Chelimsky
2010-Sep-06 13:47 UTC
[rspec-users] How can I set the host for testing subdomain constrained routes in RSpec 2?
On Sep 6, 2010, at 4:37 AM, DEfusion wrote:> I''ve tried: > host = ''foo.bar.com'' > host! (undefined method) > request.host (request undefined) > controller.request.host (controller undefined) > @controller.request.host (undefined method `request'' for nil:NilClass){ :get => "http://sub.top.com/foo/bar" }.should route_to(:controller => "foo", :action => "bar", :subdomain => "sub") HTH, David
DEfusion
2010-Sep-06 14:47 UTC
[rspec-users] How can I set the host for testing subdomain constrained routes in RSpec 2?
Thanks David, that works perfect, I didn''t think about passing the whole URL to get. On Sep 6, 2:47?pm, David Chelimsky <dchelim... at gmail.com> wrote:> On Sep 6, 2010, at 4:37 AM, DEfusion wrote: > > > I''ve tried: > > host = ''foo.bar.com'' > > host! (undefined method) > > request.host (request undefined) > > controller.request.host (controller undefined) > > @controller.request.host (undefined method `request'' for nil:NilClass) > > { :get => "http://sub.top.com/foo/bar" }.should route_to(:controller => "foo", :action => "bar", :subdomain => "sub") > > HTH, > David > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users