2012-02-11 05:09:39 +01:00
|
|
|
Feature: GZIP assets during build
|
|
|
|
|
|
|
|
Scenario: Built assets should be gzipped
|
|
|
|
Given a successfully built app at "gzip-app"
|
|
|
|
Then the following files should exist:
|
2014-05-02 19:19:18 +02:00
|
|
|
| build/index.html |
|
2012-03-05 01:42:14 +01:00
|
|
|
| build/index.html.gz |
|
|
|
|
| build/javascripts/test.js |
|
2014-05-02 19:19:18 +02:00
|
|
|
| build/javascripts/test.js.gz |
|
2012-03-05 01:42:14 +01:00
|
|
|
| build/stylesheets/test.css |
|
2014-05-02 19:19:18 +02:00
|
|
|
| build/stylesheets/test.css.gz |
|
2014-07-06 05:25:07 +02:00
|
|
|
And the file "build/javascripts/test.js.gz" should be gzipped
|
2012-02-11 05:09:39 +01:00
|
|
|
|
|
|
|
Scenario: Preview server doesn't change
|
|
|
|
Given the Server is running at "gzip-app"
|
|
|
|
When I go to "/javascripts/test.js"
|
|
|
|
Then I should see "test_function"
|
|
|
|
When I go to "/stylesheets/test.css"
|
|
|
|
Then I should see "test_selector"
|
2014-05-02 19:19:18 +02:00
|
|
|
|
|
|
|
Scenario: Only specified extensions should be gzipped
|
|
|
|
Given a fixture app "gzip-app"
|
|
|
|
And a file named "config.rb" with:
|
|
|
|
"""
|
2016-01-28 09:16:23 +01:00
|
|
|
activate :gzip, exts: %w(.htm .html .js .xhtml)
|
2014-05-02 19:19:18 +02:00
|
|
|
"""
|
|
|
|
And a successfully built app at "gzip-app"
|
|
|
|
Then the following files should exist:
|
|
|
|
| build/index.html |
|
|
|
|
| build/index.html.gz |
|
|
|
|
| build/javascripts/test.js |
|
|
|
|
| build/javascripts/test.js.gz |
|
|
|
|
| build/stylesheets/test.css |
|
|
|
|
And the following files should not exist:
|
|
|
|
| build/stylesheets/test.css.gz |
|
2014-05-02 20:41:59 +02:00
|
|
|
|
|
|
|
Scenario: Gzipped files are not produced for ignored paths
|
|
|
|
Given a fixture app "gzip-app"
|
|
|
|
And a file named "config.rb" with:
|
|
|
|
"""
|
|
|
|
activate :gzip, ignore: ['index.html', %r(javascripts/.*)]
|
|
|
|
"""
|
|
|
|
And a successfully built app at "gzip-app"
|
|
|
|
Then the following files should exist:
|
|
|
|
| build/index.html |
|
|
|
|
| build/javascripts/test.js |
|
|
|
|
| build/stylesheets/test.css |
|
|
|
|
| build/stylesheets/test.css.gz |
|
|
|
|
And the following files should not exist:
|
|
|
|
| build/index.html.gz |
|
|
|
|
| build/javascripts/test.js.gz |
|