On Jul 27, 2010, at 6:40 PM, Nicholas Wieland wrote:
> Hi *, is someone using rspec 2 and rails 3 for testing subdomains ? How do
I test for example in a route spec tis route ?
>
> match ''profile'', :to =>
''users#profile'', :constraints => { :subdomain => /.+/ }
it "routes /profile to UsersController#profile for slug" do
{ :get => "profile" }.should route_to(
:controller => :users, :action => :profile, :permalink =>
''test'' )
end
This fails with
undefined method `subdomain'' for #<Rack::Request:0x102fd16e8>
I''m not able to set the host, host! doesn''t work, or
I''m using it in the wrong way.
Someone has any idea ?
ngw