diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2011-09-12 23:04:14 -0700 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2011-09-12 23:04:14 -0700 |
commit | 038e45a2b6a71175ffe368ae9d7c920f7d1230a6 (patch) | |
tree | 3b94e70dd6b817fe14ced50318faab6cdb97cfa1 /railties/test/application/rake_test.rb | |
parent | f65b2215cd5ab54d3aca2095f51429b7e503431f (diff) | |
parent | 21eaba4c39773af3e7b279325fb8d6b5ab474ef0 (diff) | |
download | rails-038e45a2b6a71175ffe368ae9d7c920f7d1230a6.tar.gz rails-038e45a2b6a71175ffe368ae9d7c920f7d1230a6.tar.bz2 rails-038e45a2b6a71175ffe368ae9d7c920f7d1230a6.zip |
Merge pull request #2987 from kennyj/master
fix https://github.com/rails/rails/issues/2947 (with testcase)
Diffstat (limited to 'railties/test/application/rake_test.rb')
-rw-r--r-- | railties/test/application/rake_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb index 81eb7e7b24..80fd65cd9f 100644 --- a/railties/test/application/rake_test.rb +++ b/railties/test/application/rake_test.rb @@ -216,5 +216,21 @@ module ApplicationTests end end + def test_assets_precompile_ignore_asset_host + add_to_config <<-RUBY + config.action_controller.asset_host = Proc.new { |source, request| "http://www.example.com/" } + RUBY + + app_file "app/assets/javascripts/test.js.erb", <<-RUBY + alert("<%= asset_path "rails.png" %>"); + RUBY + + Dir.chdir(app_path) do + `rake assets:precompile` + open("public/assets/application.js") do |f| + assert_match(/\"\/assets\/rails.png\"/, f.read) + end + end + end end end |