Permalink
Browse files

Merge pull request #3040 from guilleiguaran/asset-host-should-not-be-…

…nil-precompile

config.action_controller.asset_host shouldn't set to nil during precompile
  • Loading branch information...
2 parents 8a32a58 + b50394b commit 79c7f2337645bade3a80271d76acc8f141d7c4d5 @josevalim josevalim committed Sep 16, 2011
Showing with 0 additions and 17 deletions.
  1. +0 −3 actionpack/lib/sprockets/assets.rake
  2. +0 −14 railties/test/application/assets_test.rb
@@ -17,9 +17,6 @@ namespace :assets do
# Always compile files
Rails.application.config.assets.compile = true
- # Always ignore asset host
- Rails.application.config.action_controller.asset_host = nil
-
config = Rails.application.config
env = Rails.application.assets
target = Pathname.new(File.join(Rails.public_path, config.assets.prefix))
@@ -270,20 +270,6 @@ class ::PostsController < ActionController::Base ; end
assert_match(/\/assets\/rails-([0-z]+)\.png/, File.read(file))
end
- test "precompile ignore asset_host" do
- app_file "app/assets/javascripts/application.css.erb", "<%= asset_path 'rails.png' %>"
- add_to_config "config.action_controller.asset_host = Proc.new { |source, request| 'http://www.example.com/' }"
-
- capture(:stdout) do
- Dir.chdir(app_path){ `bundle exec rake assets:precompile` }
- end
-
- file = Dir["#{app_path}/public/assets/application.css"].first
- content = File.read(file)
- assert_match(/\/assets\/rails.png/, content)
- assert_no_match(/www\.example\.com/, content)
- end
-
test "precompile should handle utf8 filenames" do
app_file "app/assets/images/レイルズ.png", "not a image really"
add_to_config "config.assets.precompile = [ /\.png$$/, /application.(css|js)$/ ]"

0 comments on commit 79c7f23

Please sign in to comment.