diff options
author | José Valim <jose.valim@gmail.com> | 2011-12-12 09:14:48 -0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-12-12 09:14:48 -0800 |
commit | af308ff3762c1923e9a5ecdbf2fb8f102062d675 (patch) | |
tree | 43da85efd542743a07be3cd379071bae521a6679 /railties/test | |
parent | c0466603288252a5db8a4d8cf0ca193004a542ea (diff) | |
parent | 5266eb9f611a114663c48eec0680b7050181d3de (diff) | |
download | rails-af308ff3762c1923e9a5ecdbf2fb8f102062d675.tar.gz rails-af308ff3762c1923e9a5ecdbf2fb8f102062d675.tar.bz2 rails-af308ff3762c1923e9a5ecdbf2fb8f102062d675.zip |
Merge pull request #3946 from pokonski/relative_root
Fix #3365. Default config.relative_url_root to ENV["RAILS_RELATIVE_URL_ROOT"].
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/assets_test.rb | 9 |
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 |