提交 702df0d2 编写于 作者: J Joshua Peek

Fix standalone run of routing test. Only reference controllers that are...

Fix standalone run of routing test. Only reference controllers that are provided in fake_controllers
上级 6c2a7390
...@@ -1345,20 +1345,20 @@ def test_action_left_off_when_id_is_recalled ...@@ -1345,20 +1345,20 @@ def test_action_left_off_when_id_is_recalled
set.draw do |map| set.draw do |map|
map.connect ':controller/:action/:id' map.connect ':controller/:action/:id'
end end
assert_equal '/post', set.generate( assert_equal '/books', set.generate(
{:controller => 'post', :action => 'index'}, {:controller => 'books', :action => 'index'},
{:controller => 'post', :action => 'show', :id => '10'} {:controller => 'books', :action => 'show', :id => '10'}
) )
end end
def test_query_params_will_be_shown_when_recalled def test_query_params_will_be_shown_when_recalled
set.draw do |map| set.draw do |map|
map.connect 'show_post/:parameter', :controller => 'post', :action => 'show' map.connect 'show_weblog/:parameter', :controller => 'weblog', :action => 'show'
map.connect ':controller/:action/:id' map.connect ':controller/:action/:id'
end end
assert_equal '/post/edit?parameter=1', set.generate( assert_equal '/weblog/edit?parameter=1', set.generate(
{:action => 'edit', :parameter => 1}, {:action => 'edit', :parameter => 1},
{:controller => 'post', :action => 'show', :parameter => 1} {:controller => 'weblog', :action => 'show', :parameter => 1}
) )
end end
...@@ -1380,9 +1380,9 @@ def test_format_is_not_inherit ...@@ -1380,9 +1380,9 @@ def test_format_is_not_inherit
def test_expiry_determination_should_consider_values_with_to_param def test_expiry_determination_should_consider_values_with_to_param
set.draw { |map| map.connect 'projects/:project_id/:controller/:action' } set.draw { |map| map.connect 'projects/:project_id/:controller/:action' }
assert_equal '/projects/1/post/show', set.generate( assert_equal '/projects/1/weblog/show', set.generate(
{:action => 'show', :project_id => 1}, {:action => 'show', :project_id => 1},
{:controller => 'post', :action => 'show', :project_id => '1'}) {:controller => 'weblog', :action => 'show', :project_id => '1'})
end end
def test_named_route_in_nested_resource def test_named_route_in_nested_resource
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册