aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application
diff options
context:
space:
mode:
authorGannon McGibbon <gannon.mcgibbon@gmail.com>2019-07-12 15:30:28 -0400
committerGannon McGibbon <gannon.mcgibbon@gmail.com>2019-07-22 12:35:04 -0400
commit3cf65bcb8ee3c27204dee5cac003a749973240f9 (patch)
treeb3d5537d6fe9e84ece34ef1bf4cb4e3d70226fc7 /railties/test/application
parent3b36d75c8fef2e8d3bc9db87486729d4e8229840 (diff)
downloadrails-3cf65bcb8ee3c27204dee5cac003a749973240f9.tar.gz
rails-3cf65bcb8ee3c27204dee5cac003a749973240f9.tar.bz2
rails-3cf65bcb8ee3c27204dee5cac003a749973240f9.zip
Make Active Storage routes optional
Add configuration option to turn off drawing of Active Storage routes.
Diffstat (limited to 'railties/test/application')
-rw-r--r--railties/test/application/configuration_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb
index a05d86f738..96678c395c 100644
--- a/railties/test/application/configuration_test.rb
+++ b/railties/test/application/configuration_test.rb
@@ -2593,6 +2593,21 @@ module ApplicationTests
MESSAGE
end
+ test "ActiveStorage.draw_routes can be configured via config.active_storage.draw_routes" do
+ app_file "config/environments/development.rb", <<-RUBY
+ Rails.application.configure do
+ config.active_storage.draw_routes = false
+ end
+ RUBY
+
+ output = rails("routes")
+ assert_not_includes(output, "rails_service_blob")
+ assert_not_includes(output, "rails_blob_representation")
+ assert_not_includes(output, "rails_disk_service")
+ assert_not_includes(output, "update_rails_disk_service")
+ assert_not_includes(output, "rails_direct_uploads")
+ end
+
test "hosts include .localhost in development" do
app "development"
assert_includes Rails.application.config.hosts, ".localhost"