diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2012-09-30 14:46:06 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2012-09-30 14:55:23 -0700 |
commit | 19987b64af0d543a6292c3fd9b0b877f70eab306 (patch) | |
tree | 5f461667b3017b46c8b1c166169912b229c20888 /railties | |
parent | 5cb5092a70e97d64c5df6fa899548ba44d1d066e (diff) | |
download | rails-19987b64af0d543a6292c3fd9b0b877f70eab306.tar.gz rails-19987b64af0d543a6292c3fd9b0b877f70eab306.tar.bz2 rails-19987b64af0d543a6292c3fd9b0b877f70eab306.zip |
Asset manifest includes aliases for foo.js -> foo/index.js and vice versa. Bump Sprockets requirements from 2.1+ to 2.2+ and let it answer "should we compile this asset?" for us.
Diffstat (limited to 'railties')
-rw-r--r-- | railties/test/application/assets_test.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/railties/test/application/assets_test.rb b/railties/test/application/assets_test.rb index 5a1df5d330..9e9702efb6 100644 --- a/railties/test/application/assets_test.rb +++ b/railties/test/application/assets_test.rb @@ -122,8 +122,23 @@ module ApplicationTests app_file "app/assets/javascripts/something/index.js.erb", "alert();" precompile! - assert File.exists?("#{app_path}/public/assets/something.js") + + assets = YAML.load_file("#{app_path}/public/assets/manifest.yml") + assert_not_nil assets['something/index.js'], "Expected something/index.js among #{assets.keys.inspect}" + assert_not_nil assets['something.js'], "Expected something.js among #{assets.keys.inspect}" + end + + test "precompile something/index.js for directory containing index file" do + add_to_config "config.assets.precompile = [ 'something/index.js' ]" + app_file "app/assets/javascripts/something/index.js.erb", "alert();" + + precompile! + assert File.exists?("#{app_path}/public/assets/something/index.js") + + assets = YAML.load_file("#{app_path}/public/assets/manifest.yml") + assert_not_nil assets['something/index.js'], "Expected something/index.js among #{assets.keys.inspect}" + assert_not_nil assets['something.js'], "Expected something.js among #{assets.keys.inspect}" end test "asset pipeline should use a Sprockets::Index when config.assets.digest is true" do |