diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2018-02-28 18:34:00 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-28 18:34:00 -0500 |
commit | c9fa561b2e8dd6bfe31c1850a47e2f17cac94aa6 (patch) | |
tree | 5d21cc59edd9dd6cdad5f756a797e368983e747d /railties/test/commands/routes_test.rb | |
parent | f008562dd35b0981732a69f1002eadb12850c1b2 (diff) | |
parent | c6d928f3cae28e3b531d3cc4bcde2ddca0323f11 (diff) | |
download | rails-c9fa561b2e8dd6bfe31c1850a47e2f17cac94aa6.tar.gz rails-c9fa561b2e8dd6bfe31c1850a47e2f17cac94aa6.tar.bz2 rails-c9fa561b2e8dd6bfe31c1850a47e2f17cac94aa6.zip |
Merge pull request #32130 from benoittgt/rake-routes-compact-mode
Add "rails routes --expanded" mode
Diffstat (limited to 'railties/test/commands/routes_test.rb')
-rw-r--r-- | railties/test/commands/routes_test.rb | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/railties/test/commands/routes_test.rb b/railties/test/commands/routes_test.rb index 030dcc7217..24af5de73a 100644 --- a/railties/test/commands/routes_test.rb +++ b/railties/test/commands/routes_test.rb @@ -119,6 +119,53 @@ class Rails::Command::RoutesTest < ActiveSupport::TestCase MESSAGE end + test "test rails routes with expanded option" do + app_file "config/routes.rb", <<-RUBY + Rails.application.routes.draw do + get '/cart', to: 'cart#show' + end + RUBY + + output = rails("routes", "--expanded") + assert_equal <<~MESSAGE, output + --[ Route 1 ]------------------------------------------------------------ + Prefix | cart + Verb | GET + URI | /cart(.:format) + Controller#Action | cart#show + --[ Route 2 ]------------------------------------------------------------ + Prefix | rails_service_blob + Verb | GET + URI | /rails/active_storage/blobs/:signed_id/*filename(.:format) + Controller#Action | active_storage/blobs#show + --[ Route 3 ]------------------------------------------------------------ + Prefix | rails_blob_variation + Verb | GET + URI | /rails/active_storage/variants/:signed_blob_id/:variation_key/*filename(.:format) + Controller#Action | active_storage/variants#show + --[ Route 4 ]------------------------------------------------------------ + Prefix | rails_blob_preview + Verb | GET + URI | /rails/active_storage/previews/:signed_blob_id/:variation_key/*filename(.:format) + Controller#Action | active_storage/previews#show + --[ Route 5 ]------------------------------------------------------------ + Prefix | rails_disk_service + Verb | GET + URI | /rails/active_storage/disk/:encoded_key/*filename(.:format) + Controller#Action | active_storage/disk#show + --[ Route 6 ]------------------------------------------------------------ + Prefix | update_rails_disk_service + Verb | PUT + URI | /rails/active_storage/disk/:encoded_token(.:format) + Controller#Action | active_storage/disk#update + --[ Route 7 ]------------------------------------------------------------ + Prefix | rails_direct_uploads + Verb | POST + URI | /rails/active_storage/direct_uploads(.:format) + Controller#Action | active_storage/direct_uploads#create + MESSAGE + end + private def run_routes_command(args = []) |