diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/application/configuration.rb | 2 | ||||
-rw-r--r-- | railties/test/application/assets_test.rb | 11 |
2 files changed, 8 insertions, 5 deletions
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index 3b74de690a..1a29483a73 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -34,7 +34,7 @@ module Rails @assets = ActiveSupport::OrderedOptions.new @assets.enabled = false @assets.paths = [] - @assets.precompile = [ /\w+\.(?!js|css).+/, "application.js", "application.css" ] + @assets.precompile = [ /\w+\.(?!js|css).+/, /application.(css|js)$/ ] @assets.prefix = "/assets" @assets.js_compressor = nil diff --git a/railties/test/application/assets_test.rb b/railties/test/application/assets_test.rb index b76dae8e18..afe93aa732 100644 --- a/railties/test/application/assets_test.rb +++ b/railties/test/application/assets_test.rb @@ -37,14 +37,17 @@ module ApplicationTests test "assets are compiled properly" do app_file "app/assets/javascripts/application.js", "alert();" + app_file "app/assets/javascripts/foo/application.js", "alert();" capture(:stdout) do Dir.chdir(app_path){ `bundle exec rake assets:precompile` } end - - file = Dir["#{app_path}/public/assets/application-*.js"][0] - assert_not_nil file, "Expected application.js asset to be generated, but none found" - assert_equal "alert();\n", File.read(file) + files = Dir["#{app_path}/public/assets/application-*.js"] + files << Dir["#{app_path}/public/assets/foo/application-*.js"].first + files.each do |file| + assert_not_nil file, "Expected application.js asset to be generated, but none found" + assert_equal "alert();\n", File.read(file) + end end test "assets are cleaned up properly" do |