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

Use a stylesheet instead of a javascript in test

We no longer link all js by default, so we should do this test with a
css instead (we don't care about that specifics of the dir just that its
in the manifest and in this dir).
上级 0a746967
...@@ -249,14 +249,14 @@ class User < ActiveRecord::Base; raise 'should not be reached'; end ...@@ -249,14 +249,14 @@ class User < ActiveRecord::Base; raise 'should not be reached'; end
end end
test "the manifest file should be saved by default in the same assets folder" do test "the manifest file should be saved by default in the same assets folder" do
app_file "app/assets/javascripts/application.js", "alert();" app_file "app/assets/stylesheets/test.css", "a{color: red}"
add_to_config "config.assets.prefix = '/x'" add_to_config "config.assets.prefix = '/x'"
precompile! precompile!
manifest = Dir["#{app_path}/public/x/.sprockets-manifest-*.json"].first manifest = Dir["#{app_path}/public/x/.sprockets-manifest-*.json"].first
assets = ActiveSupport::JSON.decode(File.read(manifest)) assets = ActiveSupport::JSON.decode(File.read(manifest))
assert_match(/application-([0-z]+)\.js/, assets["assets"]["application.js"]) assert_match(/test-([0-z]+)\.css/, assets["assets"]["test.css"])
end end
test "assets do not require any assets group gem when manifest file is present" do test "assets do not require any assets group gem when manifest file is present" do
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册