1
0
Fork 0
mirror of https://github.com/middleman/middleman.git synced 2022-11-09 12:20:27 -05:00
middleman--middleman/middleman-core/features/cache_buster.feature
Paul McMahon 4fe0732713
Cleanup of how fixtures customize a fixture (#2342)
* Use "Given" instead of "And" as first scenario step

* Remove unnecessary step

The following step already invokes this step

* Remove setup in feature that doesn't do anything

As this referenced "i18n-test-app", but later we run
"i18n-mixed-sources", these steps weren't doing anything.

* Avoid referencing the same fixture twice

The step "the Server is running at" invokes the "a fixture app" step,
followed by "the Server is running" step.
2020-06-15 11:19:39 -07:00

56 lines
2.1 KiB
Gherkin

Feature: Generate mtime-based query string for busting browser caches
In order to display the most recent content for IE & CDNs and appease YSlow
Scenario: Rendering css with the feature disabled
Given "cache_buster" feature is "disabled"
And the Server is running at "cache-buster-app"
When I go to "/stylesheets/relative_assets.css"
Then I should see 'blank.gif"'
Scenario: Rendering html with the feature disabled
Given "cache_buster" feature is "disabled"
And the Server is running at "cache-buster-app"
When I go to "/cache-buster.html"
Then I should see 'site.css"'
Scenario: Rendering css with the feature enabled
Given "cache_buster" feature is "enabled"
And the Server is running at "cache-buster-app"
When I go to "/stylesheets/relative_assets.css"
Then I should see "blank.gif?"
Scenario: Rendering html with the feature enabled
Given "cache_buster" feature is "enabled"
And the Server is running at "cache-buster-app"
When I go to "/cache-buster.html"
Then I should see "site.css?"
Then I should see "blank.gif?"
Scenario: Rendering css with the feature and relative_assets enabled
Given "relative_assets" feature is "enabled"
Given "cache_buster" feature is "enabled"
And the Server is running at "cache-buster-app"
When I go to "/stylesheets/relative_assets.css"
Then I should see "blank.gif?"
Scenario: Rendering html with the feature and relative_assets enabled
Given "relative_assets" feature is "enabled"
Given "cache_buster" feature is "enabled"
And the Server is running at "cache-buster-app"
When I go to "/cache-buster.html"
Then I should see "site.css?"
Then I should see "blank.gif?"
Scenario: URLs are not rewritten for rewrite ignored paths
Given a fixture app "cache-buster-app"
And a file named "config.rb" with:
"""
activate :cache_buster, rewrite_ignore: [
'/cache-buster.html',
]
"""
And the Server is running
When I go to "/cache-buster.html"
Then I should see 'site.css"'
Then I should see 'empty-with-include.js"'
Then I should see 'blank.gif"'