aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEileen M. Uchitelle <eileencodes@users.noreply.github.com>2016-11-19 15:41:09 -0500
committerGitHub <noreply@github.com>2016-11-19 15:41:09 -0500
commit64127cde8c0bfff9b88710f83a8305f1ee96374b (patch)
tree86a365d94a9306a43d9c188662367ac63dad0dd8
parent1cf995688d8df0bc4a473a0e41dc2240e413bb44 (diff)
parentb945c9ad62a0c14fffda8f08d6cf3fdc1141e3a9 (diff)
downloadrails-64127cde8c0bfff9b88710f83a8305f1ee96374b.tar.gz
rails-64127cde8c0bfff9b88710f83a8305f1ee96374b.tar.bz2
rails-64127cde8c0bfff9b88710f83a8305f1ee96374b.zip
Merge pull request #27106 from prathamesh-sonpatki/add-missing-test
Add missing test for singular resource output in rake routes
-rw-r--r--railties/test/application/rake_test.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb
index 1288d43231..cd09270df1 100644
--- a/railties/test/application/rake_test.rb
+++ b/railties/test/application/rake_test.rb
@@ -174,6 +174,26 @@ module ApplicationTests
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