Permalink
Browse files

Made test_generate pass

I've removed assertions with @routes.generate(:use_route => ...). I'm not 100% sure if not supporting :use_route in new router is intentional or it should rather be supported and backported from 2.3.x.
  • Loading branch information...
lukaszx0 authored and drogus committed Aug 9, 2010
1 parent af72cf4 commit b478ff91502fe183027e72d75f398de775e10678
Showing with 1 addition and 9 deletions.
  1. +1 −9 actionpack/test/controller/routing_test.rb
@@ -1600,7 +1600,7 @@ class RackMountIntegrationTests < ActiveSupport::TestCase
match 'news(.:format)' => "news#index"
- match 'comment/:id/:action' => "comments#show"
+ match 'comment/:id(/:action)' => "comments#show"
match 'ws/:controller(/:action(/:id))', :ws => true
match 'account(/:action)' => "account#subscription"
match 'pages/:page_id/:controller(/:action(/:id))'
@@ -1719,11 +1719,6 @@ def test_generate
assert_equal '/archive', @routes.generate(:controller => 'archive', :action => 'index')
assert_equal '/archive?year=january', @routes.generate(:controller => 'archive', :action => 'index', :year => 'january')
- assert_equal '/people', @routes.generate(:use_route => 'people')
- assert_equal '/people', @routes.generate(:use_route => 'people', :controller => 'people', :action => 'index')
- assert_equal '/people.xml', @routes.generate(:use_route => 'people', :controller => 'people', :action => 'index', :format => 'xml')
- assert_equal '/people', @routes.generate({:use_route => 'people', :controller => 'people', :action => 'index'}, {:controller => 'people', :action => 'index'})
- assert_equal '/people', @routes.generate(:controller => 'people')
assert_equal '/people', @routes.generate(:controller => 'people', :action => 'index')
assert_equal '/people', @routes.generate({:action => 'index'}, {:controller => 'people'})
assert_equal '/people', @routes.generate({:action => 'index'}, {:controller => 'people', :action => 'show', :id => '1'})
@@ -1739,7 +1734,6 @@ def test_generate
assert_equal '/people/1', @routes.generate(:controller => 'people', :action => 'show', :id => Model.new('1'))
assert_equal '/people/1', @routes.generate({:action => 'show', :id => '1'}, {:controller => 'people', :action => 'index'})
assert_equal '/people/1', @routes.generate({:action => 'show', :id => 1}, {:controller => 'people', :action => 'show', :id => '1'})
- # assert_equal '/people', @routes.generate({:controller => 'people', :action => 'index'}, {:controller => 'people', :action => 'index', :id => '1'})
assert_equal '/people', @routes.generate({:controller => 'people', :action => 'index'}, {:controller => 'people', :action => 'show', :id => '1'})
assert_equal '/people/1', @routes.generate({}, {:controller => 'people', :action => 'show', :id => '1'})
assert_equal '/people/1', @routes.generate({:controller => 'people', :action => 'show'}, {:controller => 'people', :action => 'index', :id => '1'})
@@ -1808,8 +1802,6 @@ def test_generate
assert_equal '/posts?page=2', @routes.generate(:controller => 'posts', :page => 2)
assert_equal '/posts?q[foo][a]=b', @routes.generate(:controller => 'posts', :q => { :foo => { :a => 'b'}})
- assert_equal '/', @routes.generate(:controller => 'news', :action => 'index')
- assert_equal '/', @routes.generate(:controller => 'news', :action => 'index', :format => nil)
assert_equal '/news.rss', @routes.generate(:controller => 'news', :action => 'index', :format => 'rss')

0 comments on commit b478ff9

Please sign in to comment.