diff options
author | Abhishek Jain <jainabhishek1610@gmail.com> | 2016-02-11 15:16:33 +0530 |
---|---|---|
committer | Abhishek Jain <jainabhishek1610@gmail.com> | 2016-02-11 15:16:33 +0530 |
commit | 4e3931aac20bc17e935dfbbbdf46ed1d2131ec74 (patch) | |
tree | 7bb0cd22af29cba78a778d10e4681cc03f7a7041 /railties/test | |
parent | 31778a34a8c6e1d186c1e807491c1f44c5f07357 (diff) | |
download | rails-4e3931aac20bc17e935dfbbbdf46ed1d2131ec74.tar.gz rails-4e3931aac20bc17e935dfbbbdf46ed1d2131ec74.tar.bz2 rails-4e3931aac20bc17e935dfbbbdf46ed1d2131ec74.zip |
Fixes routes to match verbs and path with -g option
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/rake_test.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb index 745a3e3ec5..fce0c95179 100644 --- a/railties/test/application/rake_test.rb +++ b/railties/test/application/rake_test.rb @@ -179,12 +179,20 @@ module ApplicationTests app_file "config/routes.rb", <<-RUBY Rails.application.routes.draw do get '/cart', to: 'cart#show' - get '/basketball', to: 'basketball#index' + post '/cart', to: 'cart#create' + get '/basketballs', to: 'basketball#index' end RUBY output = Dir.chdir(app_path){ `bin/rails routes -g show` } assert_equal "Prefix Verb URI Pattern Controller#Action\n cart GET /cart(.:format) cart#show\n", output + + output = Dir.chdir(app_path){ `bin/rails routes -g POST` } + assert_equal "Prefix Verb URI Pattern Controller#Action\n POST /cart(.:format) cart#create\n", output + + output = Dir.chdir(app_path){ `bin/rails routes -g basketballs` } + assert_equal " Prefix Verb URI Pattern Controller#Action\n" \ + "basketballs GET /basketballs(.:format) basketball#index\n", output end def test_rake_routes_with_controller_search_key |