aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2016-02-12 20:20:14 +0100
committerKasper Timm Hansen <kaspth@gmail.com>2016-02-12 20:20:14 +0100
commit8c53b41293cd27a1d0c0b1d6d9f51f04f20ca465 (patch)
tree28a0f8bbbf0a2aaf31cd853e2d8e4dc7dc643ad0 /railties
parentda1fbb9a00e330331d00f27c8a40ea62d0d1d224 (diff)
parent4e3931aac20bc17e935dfbbbdf46ed1d2131ec74 (diff)
downloadrails-8c53b41293cd27a1d0c0b1d6d9f51f04f20ca465.tar.gz
rails-8c53b41293cd27a1d0c0b1d6d9f51f04f20ca465.tar.bz2
rails-8c53b41293cd27a1d0c0b1d6d9f51f04f20ca465.zip
Merge pull request #23611 from abhishekjain16/routes_options
Fix routes to match verb and URL path with -g option also.
Diffstat (limited to 'railties')
-rw-r--r--railties/test/application/rake_test.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb
index 3d3e47de8d..d1c828b509 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