mirror of
https://github.com/middleman/middleman.git
synced 2022-11-09 12:20:27 -05:00
4fe0732713
* 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.
81 lines
2 KiB
Gherkin
81 lines
2 KiB
Gherkin
Feature: Support slim templating language
|
|
In order to offer an alternative to Haml
|
|
|
|
Scenario: Rendering Slim
|
|
Given an empty app
|
|
And a file named "config.rb" with:
|
|
"""
|
|
"""
|
|
And a file named "source/slim.html.slim" with:
|
|
"""
|
|
doctype 5
|
|
html lang='en'
|
|
head
|
|
meta charset="utf-8"
|
|
|
|
body
|
|
h1 Welcome to Slim
|
|
"""
|
|
And the Server is running
|
|
When I go to "/slim.html"
|
|
Then I should see "<h1>Welcome to Slim</h1>"
|
|
|
|
Scenario: Slim Content For
|
|
Given the Server is running at "slim-content-for-app"
|
|
When I go to "/index.html"
|
|
Then I should not see "Content AContent B"
|
|
Then I should see "Content for A:Content A"
|
|
Then I should see "Content for main:Content Main"
|
|
Then I should see "Content for B:Content B"
|
|
|
|
Scenario: Rendering Scss in a Slim filter
|
|
Given an empty app
|
|
And a file named "config.rb" with:
|
|
"""
|
|
"""
|
|
And a file named "source/scss.html.slim" with:
|
|
"""
|
|
doctype 5
|
|
html lang='en'
|
|
head
|
|
meta charset="utf-8"
|
|
scss:
|
|
@mixin global-reset {
|
|
html, body, div {
|
|
padding: 0;
|
|
}
|
|
}
|
|
@include global-reset;
|
|
body
|
|
h1 Welcome to Slim
|
|
"""
|
|
And a file named "source/sass.html.slim" with:
|
|
"""
|
|
doctype 5
|
|
html lang='en'
|
|
head
|
|
meta charset="utf-8"
|
|
sass:
|
|
html, body, div
|
|
padding: 0
|
|
body
|
|
h1 Welcome to Slim
|
|
"""
|
|
And a file named "source/error.html.slim" with:
|
|
"""
|
|
doctype 5
|
|
html lang='en'
|
|
head
|
|
meta charset="utf-8"
|
|
scss:
|
|
+global-reset2
|
|
body
|
|
h1 Welcome to Slim
|
|
"""
|
|
And the Server is running
|
|
When I go to "/scss.html"
|
|
Then I should see "html,body,div"
|
|
When I go to "/sass.html"
|
|
Then I should see "html,body,div"
|
|
When I go to "/error.html"
|
|
Then I should see "Error:"
|