未验证 提交 b40705fa 编写于 作者: J John Hawthorn 提交者: Rafael Mendonça França

Fix Sprockets::DoubleLinkError in test

上级 10c99d98
...@@ -186,6 +186,7 @@ class User < ActiveRecord::Base; raise 'should not be reached'; end ...@@ -186,6 +186,7 @@ class User < ActiveRecord::Base; raise 'should not be reached'; end
test "sprockets cache is not shared between environments" do test "sprockets cache is not shared between environments" do
app_file "app/assets/images/rails.png", "notactuallyapng" app_file "app/assets/images/rails.png", "notactuallyapng"
remove_file "app/assets/stylesheets/application.css"
app_file "app/assets/stylesheets/application.css.erb", "body { background: '<%= asset_path('rails.png') %>'; }" app_file "app/assets/stylesheets/application.css.erb", "body { background: '<%= asset_path('rails.png') %>'; }"
add_to_env_config "production", 'config.assets.prefix = "production_assets"' add_to_env_config "production", 'config.assets.prefix = "production_assets"'
...@@ -234,6 +235,7 @@ class User < ActiveRecord::Base; raise 'should not be reached'; end ...@@ -234,6 +235,7 @@ class User < ActiveRecord::Base; raise 'should not be reached'; end
test "precompile creates a manifest file with all the assets listed" do test "precompile creates a manifest file with all the assets listed" do
app_file "app/assets/images/rails.png", "notactuallyapng" app_file "app/assets/images/rails.png", "notactuallyapng"
remove_file "app/assets/stylesheets/application.css"
app_file "app/assets/stylesheets/application.css.erb", "<%= asset_path('rails.png') %>" app_file "app/assets/stylesheets/application.css.erb", "<%= asset_path('rails.png') %>"
app_file "app/assets/javascripts/application.js", "alert();" app_file "app/assets/javascripts/application.js", "alert();"
...@@ -278,6 +280,7 @@ class User < ActiveRecord::Base; raise 'should not be reached'; end ...@@ -278,6 +280,7 @@ class User < ActiveRecord::Base; raise 'should not be reached'; end
test "precompile properly refers files referenced with asset_path" do test "precompile properly refers files referenced with asset_path" do
app_file "app/assets/images/rails.png", "notactuallyapng" app_file "app/assets/images/rails.png", "notactuallyapng"
remove_file "app/assets/stylesheets/application.css"
app_file "app/assets/stylesheets/application.css.erb", "p { background-image: url(<%= asset_path('rails.png') %>) }" app_file "app/assets/stylesheets/application.css.erb", "p { background-image: url(<%= asset_path('rails.png') %>) }"
precompile! precompile!
...@@ -289,6 +292,7 @@ class User < ActiveRecord::Base; raise 'should not be reached'; end ...@@ -289,6 +292,7 @@ class User < ActiveRecord::Base; raise 'should not be reached'; end
test "precompile shouldn't use the digests present in manifest.json" do test "precompile shouldn't use the digests present in manifest.json" do
app_file "app/assets/images/rails.png", "notactuallyapng" app_file "app/assets/images/rails.png", "notactuallyapng"
remove_file "app/assets/stylesheets/application.css"
app_file "app/assets/stylesheets/application.css.erb", "p { background-image: url(<%= asset_path('rails.png') %>) }" app_file "app/assets/stylesheets/application.css.erb", "p { background-image: url(<%= asset_path('rails.png') %>) }"
precompile! RAILS_ENV: "production" precompile! RAILS_ENV: "production"
...@@ -307,6 +311,7 @@ class User < ActiveRecord::Base; raise 'should not be reached'; end ...@@ -307,6 +311,7 @@ class User < ActiveRecord::Base; raise 'should not be reached'; end
test "precompile appends the MD5 hash to files referenced with asset_path and run in production with digest true" do test "precompile appends the MD5 hash to files referenced with asset_path and run in production with digest true" do
app_file "app/assets/images/rails.png", "notactuallyapng" app_file "app/assets/images/rails.png", "notactuallyapng"
remove_file "app/assets/stylesheets/application.css"
app_file "app/assets/stylesheets/application.css.erb", "p { background-image: url(<%= asset_path('rails.png') %>) }" app_file "app/assets/stylesheets/application.css.erb", "p { background-image: url(<%= asset_path('rails.png') %>) }"
precompile! RAILS_ENV: "production" precompile! RAILS_ENV: "production"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册