spec/private/recognize_spec.rb in usher-0.5.11 vs spec/private/recognize_spec.rb in usher-0.5.12
- old
+ new
@@ -62,16 +62,15 @@
secure_product_show_route.should == @route_set.recognize(build_request({:method => 'get', :path => '/products/show/123', :domain => 'admin.host.com', :user_agent => true})).path.route
insecure_product_show_route.should == @route_set.recognize(build_request({:method => 'get', :path => '/products/show/123', :domain => 'admin.host.com', :user_agent => false})).path.route
end
- it "should use conditionals that are arrays" do
+ it "should use flatten and use conditionals that are arrays" do
# hijacking user_agent
- www_product_show_route = @route_set.add_route('/products/show/:id', :id => /\d+/, :conditions => {:subdomains => ['www'], :method => 'get'})
- admin_product_show_route = @route_set.add_route('/products/show/:id', :id => /\d+/, :conditions => {:subdomains => ['admin'], :method => 'get'})
+ www_product_show_route = @route_set.add_route('/products/show/:id', :id => /\d+/, :conditions => {:subdomains => ['www', 'admin'], :method => 'get'})
- admin_product_show_route.should == @route_set.recognize(build_request({:method => 'get', :path => '/products/show/123', :subdomains => ['admin'], :user_agent => true})).path.route
- www_product_show_route.should == @route_set.recognize(build_request({:method => 'get', :path => '/products/show/123', :subdomains => ['www'], :user_agent => false})).path.route
+ www_product_show_route.should == @route_set.recognize(build_request({:method => 'get', :path => '/products/show/123', :subdomains => 'admin', :user_agent => true})).path.route
+ www_product_show_route.should == @route_set.recognize(build_request({:method => 'get', :path => '/products/show/123', :subdomains => 'www', :user_agent => false})).path.route
end
end
it "should recognize a format-style variable" do
target_route = @route_set.add_route('/sample.:format', :controller => 'sample', :action => 'action')