Skip to content

Commit

Permalink
Use a stylesheet instead of a javascript in test
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
jhawthorn authored and rafaelfranca committed Nov 22, 2019
1 parent 0a74696 commit aeadae2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions railties/test/application/assets_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,14 @@ class User < ActiveRecord::Base; raise 'should not be reached'; end
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
Expand Down

0 comments on commit aeadae2

Please sign in to comment.