1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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).
This commit is contained in:
John Hawthorn 2019-10-09 21:05:50 -07:00
parent 5a4d4c7492
commit e63695535e

View file

@ -235,14 +235,14 @@ module ApplicationTests
end
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'"
precompile!
manifest = Dir["#{app_path}/public/x/.sprockets-manifest-*.json"].first
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
test "assets do not require any assets group gem when manifest file is present" do