diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2018-09-15 10:22:04 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2018-09-15 10:22:04 +0900 |
commit | 70b5a7594e91d7e3f3ee60642102b7a2323c2e0c (patch) | |
tree | 5991a2ed454b3574d6e2580b9940f412f1bc5a5e | |
parent | 65bf046fd1c05405591b940e3b3cd718ca1edba1 (diff) | |
download | rails-70b5a7594e91d7e3f3ee60642102b7a2323c2e0c.tar.gz rails-70b5a7594e91d7e3f3ee60642102b7a2323c2e0c.tar.bz2 rails-70b5a7594e91d7e3f3ee60642102b7a2323c2e0c.zip |
Add test for `config.active_storage.routes_prefix`
Follow up #33883.
-rw-r--r-- | railties/test/application/configuration_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index 44f6af5d4a..11cd6dd1e6 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -2053,6 +2053,24 @@ module ApplicationTests assert_equal [ "password", "credit_card_number" ].to_set, ActiveRecord::Base.filter_attributes end + test "ActiveStorage.routes_prefix can be configured via config.active_storage.routes_prefix" do + app_file "config/environments/development.rb", <<-RUBY + Rails.application.configure do + config.active_storage.routes_prefix = '/files' + end + RUBY + + output = rails("routes", "-g", "active_storage") + assert_equal <<~MESSAGE, output + Prefix Verb URI Pattern Controller#Action + rails_service_blob GET /files/blobs/:signed_id/*filename(.:format) active_storage/blobs#show + rails_blob_representation GET /files/representations/:signed_blob_id/:variation_key/*filename(.:format) active_storage/representations#show + rails_disk_service GET /files/disk/:encoded_key/*filename(.:format) active_storage/disk#show + update_rails_disk_service PUT /files/disk/:encoded_token(.:format) active_storage/disk#update + rails_direct_uploads POST /files/direct_uploads(.:format) active_storage/direct_uploads#create + MESSAGE + end + private def force_lazy_load_hooks yield # Tasty clarifying sugar, homie! We only need to reference a constant to load it. |