提交 e43a99e2 编写于 作者: R Rafael Mendonça França

Merge pull request #10783 from wangjohn/rake_routes_additional_environment

Adding the ability to filter routes by the verb
......@@ -151,6 +151,18 @@ def test_rake_routes_calls_the_route_inspector
assert_equal "Prefix Verb URI Pattern Controller#Action\ncart GET /cart(.:format) cart#show\n", output
end
def test_rake_routes_with_controller_environment
app_file "config/routes.rb", <<-RUBY
AppTemplate::Application.routes.draw do
get '/cart', to: 'cart#show'
get '/basketball', to: 'basketball#index'
end
RUBY
output = Dir.chdir(app_path){ `CONTROLLER=cart rake routes` }
assert_equal "Prefix Verb URI Pattern Controller#Action\ncart GET /cart(.:format) cart#show\n", output
end
def test_rake_routes_displays_message_when_no_routes_are_defined
app_file "config/routes.rb", <<-RUBY
AppTemplate::Application.routes.draw do
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册