config.action_controller.asset_host shouldn't set to nil during precompile

This commit is contained in:
Guillermo Iguaran 2011-09-15 19:55:52 -05:00
parent 8a32a58f6f
commit b50394bf84
2 changed files with 0 additions and 17 deletions

View File

@ -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))

View File

@ -270,20 +270,6 @@ module ApplicationTests
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)$/ ]"