flowerbox-delivery/features/process_with_sprockets.feature

53 lines
1.6 KiB
Gherkin
Raw Normal View History

2012-01-23 16:58:20 +00:00
Feature: Process files with Sprockets
2012-01-23 17:21:11 +00:00
Background:
2012-01-23 16:58:20 +00:00
Given I have the file "dir/file.js" with the content:
"""
//= require other
a file
"""
And I have the file "dir/other.js" with the content:
"""
another file
"""
2012-01-23 17:21:11 +00:00
2012-01-30 16:34:57 +00:00
@fakefs
2012-01-23 17:21:11 +00:00
Scenario: Simple Sprockets work
When I instantiate a Sprockets handler with the following asset directories:
| dir |
And I work with the Sprockets asset "file"
Then the handler should have the following files in order:
| dir/other.js |
| dir/file.js |
2012-01-30 16:34:57 +00:00
@fakefs
2012-01-23 17:21:11 +00:00
Scenario: Require the file twice
Given I have the file "dir/third.js" with the content:
"""
//= require other
third file
"""
2012-01-23 16:58:20 +00:00
When I instantiate a Sprockets handler with the following asset directories:
| dir |
And I work with the Sprockets asset "file"
2012-01-23 17:21:11 +00:00
And I work with the Sprockets asset "third"
2012-01-23 16:58:20 +00:00
Then the handler should have the following files in order:
| dir/other.js |
| dir/file.js |
2012-01-23 17:21:11 +00:00
| dir/third.js |
2012-01-23 16:58:20 +00:00
2012-01-30 16:34:57 +00:00
@realfs
Scenario: A CoffeeScript file
Given I have the file "dir/third.js.coffee" with the content:
"""
#= require other
for file in [ 'files' ]
alert(file)
"""
When I instantiate a Sprockets handler with the following asset directories:
| dir |
And I work with the Sprockets asset "third"
Then the handler should have the following files in order:
| dir/other.js |
| <%= temp_path_for("dir/third.js.coffee") %> |
And there should be a temp file for the local path "dir/third.js.coffee"