aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-03-05 13:11:53 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2015-03-05 13:12:06 -0800
commit798a14a6388ac525109e550d72bba0b1118e5e2e (patch)
treecad588c08fd1a4aa2e7a67c3899d131146f14e05 /railties/test/application
parentad23aab7b30612d77bf746e6c0ae7a7140de0144 (diff)
downloadrails-798a14a6388ac525109e550d72bba0b1118e5e2e.tar.gz
rails-798a14a6388ac525109e550d72bba0b1118e5e2e.tar.bz2
rails-798a14a6388ac525109e550d72bba0b1118e5e2e.zip
pass a config to the route set
This way we can get the relative_url_root from the application without setting another global value
Diffstat (limited to 'railties/test/application')
-rw-r--r--railties/test/application/url_generation_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/railties/test/application/url_generation_test.rb b/railties/test/application/url_generation_test.rb
index ef16ab56ed..894e18cb39 100644
--- a/railties/test/application/url_generation_test.rb
+++ b/railties/test/application/url_generation_test.rb
@@ -42,5 +42,18 @@ module ApplicationTests
get "/"
assert_equal "/", last_response.body
end
+
+ def test_routes_know_the_relative_root
+ boot_rails
+ require "rails"
+ require "action_controller/railtie"
+ require "action_view/railtie"
+
+ relative_url = '/hello'
+ ENV["RAILS_RELATIVE_URL_ROOT"] = relative_url
+ app = Class.new(Rails::Application)
+ assert_equal relative_url, app.routes.relative_url_root
+ ENV["RAILS_RELATIVE_URL_ROOT"] = nil
+ end
end
end