aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application
diff options
context:
space:
mode:
authorPiotrek Okoński <piotrek@okonski.org>2011-12-12 16:52:56 +0100
committerPiotrek Okoński <piotrek@okonski.org>2011-12-12 17:11:07 +0100
commit5266eb9f611a114663c48eec0680b7050181d3de (patch)
tree43da85efd542743a07be3cd379071bae521a6679 /railties/test/application
parentc0466603288252a5db8a4d8cf0ca193004a542ea (diff)
downloadrails-5266eb9f611a114663c48eec0680b7050181d3de.tar.gz
rails-5266eb9f611a114663c48eec0680b7050181d3de.tar.bz2
rails-5266eb9f611a114663c48eec0680b7050181d3de.zip
Default relative_url_root to ENV["RAILS_RELATIVE_URL_ROOT"]. Fixes #3365
Diffstat (limited to 'railties/test/application')
-rw-r--r--railties/test/application/assets_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/railties/test/application/assets_test.rb b/railties/test/application/assets_test.rb
index 392bef3fd1..a08ea77ff3 100644
--- a/railties/test/application/assets_test.rb
+++ b/railties/test/application/assets_test.rb
@@ -478,6 +478,15 @@ module ApplicationTests
assert_match 'src="//example.com/assets/rails.png"', File.read("#{app_path}/public/assets/image_loader.js")
end
+ test "asset paths should use RAILS_RELATIVE_URL_ROOT by default" do
+ ENV["RAILS_RELATIVE_URL_ROOT"] = "/sub/uri"
+
+ app_file "app/assets/javascripts/app.js.erb", 'var src="<%= image_path("rails.png") %>";'
+ add_to_config "config.assets.precompile = %w{app.js}"
+ precompile!
+
+ assert_match 'src="/sub/uri/assets/rails.png"', File.read("#{app_path}/public/assets/app.js")
+ end
private