Permalink
Browse files

Merge pull request #14852 from matthewd/fix_build_for_assets

Fix railties asset tests: precompile the image we're referencing
Conflicts:
	railties/test/application/assets_test.rb
  • Loading branch information...
1 parent c20fe80 commit 1c7eec15a85f857cd6116a5257af735bd406bca0 @rafaelfranca rafaelfranca committed Apr 23, 2014
Showing with 4 additions and 4 deletions.
  1. +4 −4 railties/test/application/assets_test.rb
@@ -449,8 +449,8 @@ class ::PostsController < ActionController::Base; end
test "asset urls should be protocol-relative if no request is in scope" do
app_file "app/assets/images/rails.png", "notreallyapng"
- app_file "app/assets/javascripts/image_loader.js.erb", "//= depend_on_asset 'rails.png'\n\nvar src='<%= image_path('rails.png') %>';"
- add_to_config "config.assets.precompile = %w{image_loader.js}"
+ app_file "app/assets/javascripts/image_loader.js.erb", "var src='<%= image_path('rails.png') %>';"
+ add_to_config "config.assets.precompile = %w{rails.png image_loader.js}"
add_to_config "config.asset_host = 'example.com'"
precompile!
@@ -461,8 +461,8 @@ class ::PostsController < ActionController::Base; end
ENV["RAILS_RELATIVE_URL_ROOT"] = "/sub/uri"
app_file "app/assets/images/rails.png", "notreallyapng"
- app_file "app/assets/javascripts/app.js.erb", "//= depend_on_asset 'rails.png'\n\nvar src='<%= image_path('rails.png') %>';"
- add_to_config "config.assets.precompile = %w{app.js}"
+ app_file "app/assets/javascripts/app.js.erb", "var src='<%= image_path('rails.png') %>';"
+ add_to_config "config.assets.precompile = %w{rails.png app.js}"
precompile!
assert_match "src='/sub/uri/assets/rails.png'", File.read(Dir["#{app_path}/public/assets/app-*.js"].first)

0 comments on commit 1c7eec1

Please sign in to comment.