Skip to content

Commit

Permalink
Test to see if nil imported_asset_path works.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brad Chen committed Aug 26, 2016
1 parent 0927d98 commit 386004e
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions features/test_cases/imported_asset_path_nil.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
Feature: Imported assets are built with the correct extensions without any asset path prefix

Background:
Given a fixture app "base-app"
And a file named "config.rb" with:
"""
activate :sprockets do |config|
config.imported_asset_path = nil
end
sprockets.append_path File.join(root, 'vendor')
"""
And a file named "vendor/fonts/webfont-vendor.svg" with:
"""
"""
And a file named "vendor/fonts/webfont-vendor.svg.gz" with:
"""
"""
And a file named "vendor/fonts/webfont-vendor.ttf.gz" with:
"""
"""
And a file named "source/fonts/webfont-source.svg" with:
"""
"""
And a file named "source/fonts/webfont-source.svg.gz" with:
"""
"""
And a file named "source/fonts/webfont-source.ttf.gz" with:
"""
"""
And a file named "vendor/images/drawing-vendor.svg" with:
"""
"""
And a file named "source/images/drawing-source.svg" with:
"""
"""
And a file named "vendor/images/extensions-source.svg.gz" with:
"""
"""
And a file named "vendor/images/extensions-source.min.js" with:
"""
"""
And a file named "vendor/images/extensions-source.asdf.asdf.min.js.asdf" with:
"""
"""


Scenario: Assets built by being linked are built with the right extension
Given a file named "source/stylesheets/manifest.css" with:
"""
//= link 'fonts/webfont-vendor.svg'
//= link 'fonts/webfont-vendor.svg.gz'
//= link 'fonts/webfont-vendor.ttf.gz'
//= link 'images/drawing-vendor.svg'
//= link 'images/extensions-source.svg.gz'
//= link 'images/extensions-source.min.js'
//= link 'images/extensions-source.asdf.asdf.min.js.asdf'
"""
And a successfully built app

When I cd to "build"
Then the following files should exist:
| fonts/webfont-vendor.svg |
| fonts/webfont-vendor.svg.gz |
| fonts/webfont-vendor.ttf.gz |
| images/drawing-vendor.svg |
| images/extensions-source.svg.gz |
| images/extensions-source.min.js |
| images/extensions-source.asdf.asdf.min.js.asdf |

Scenario: Assets in source don't have their extensions mangled
Given a successfully built app

When I cd to "build"
Then the following files should exist:
| fonts/webfont-source.svg |
| fonts/webfont-source.svg.gz |
| fonts/webfont-source.ttf.gz |
| images/drawing-source.svg |

0 comments on commit 386004e

Please sign in to comment.