Permalink
Browse files

Merge pull request #27106 from prathamesh-sonpatki/add-missing-test

Add missing test for singular resource output in rake routes
  • Loading branch information...
eileencodes committed Nov 19, 2016
2 parents 1cf9956 + b945c9a commit 64127cde8c0bfff9b88710f83a8305f1ee96374b
Showing with 20 additions and 0 deletions.
  1. +20 −0 railties/test/application/rake_test.rb
@@ -174,6 +174,26 @@ def test_rails_routes_with_namespaced_controller_environment
assert_equal expected_output, output
end
def test_singular_resource_output_in_rake_routes
app_file "config/routes.rb", <<-RUBY
Rails.application.routes.draw do
resource :post
end
RUBY
expected_output = [" Prefix Verb URI Pattern Controller#Action",
" new_post GET /post/new(.:format) posts#new",
"edit_post GET /post/edit(.:format) posts#edit",
" post GET /post(.:format) posts#show",
" PATCH /post(.:format) posts#update",
" PUT /post(.:format) posts#update",
" DELETE /post(.:format) posts#destroy",
" POST /post(.:format) posts#create\n"].join("\n")
output = Dir.chdir(app_path) { `bin/rails routes -c PostController` }
assert_equal expected_output, output
end
def test_rails_routes_with_global_search_key
app_file "config/routes.rb", <<-RUBY
Rails.application.routes.draw do

0 comments on commit 64127cd

Please sign in to comment.