Forum: RSpec stricter routing specs with conditional routes

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
945934fe00ad144a630c7d63a485054f?d=identicon&s=25 max@gorbul.net (Guest)
on 2009-03-24 23:14
(Received via mailing list)
Hello,

could you please advise me how to test conditional routes with rspec
v1.2.0 ?
I have something like the following in my application.
------------
map.with_options(:namespace => "admin/",
                  :conditions => { :subdomain => /^admin$/i },
                  :name_prefix => "admin_") do |admin|
   admin.resources(:users)
   admin.resources(:messages)
end
------------
Before 1.2.0 all specs run without failures. After I upgraded to rails
2.3 with rspec 1.2.0 I got a ton of failed spec related to mismatched
routes:

route_for(:controller => "admin/users", :id=>"1", :action =>
"create").
   should == {:path => "/admin/users/1", :method => :post}

this spec is failed because :subdomain => nil

How to deal with such issue?

Thank you,
Max
This topic is locked and can not be replied to.