2011-06-02 13:48:56 -04:00
|
|
|
Feature: Support slim templating language
|
|
|
|
In order to offer an alternative to Haml
|
|
|
|
|
|
|
|
Scenario: Rendering Slim
|
2012-04-26 19:21:53 -04:00
|
|
|
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
|
|
|
|
"""
|
2020-06-15 14:19:39 -04:00
|
|
|
And the Server is running
|
2011-06-02 13:48:56 -04:00
|
|
|
When I go to "/slim.html"
|
2012-08-16 16:48:34 -04:00
|
|
|
Then I should see "<h1>Welcome to Slim</h1>"
|
|
|
|
|
2014-08-04 17:41:22 -04:00
|
|
|
Scenario: Slim Content For
|
|
|
|
Given the Server is running at "slim-content-for-app"
|
|
|
|
When I go to "/index.html"
|
2014-08-04 18:07:55 -04:00
|
|
|
Then I should not see "Content AContent B"
|
2014-08-04 17:41:22 -04:00
|
|
|
Then I should see "Content for A:Content A"
|
|
|
|
Then I should see "Content for main:Content Main"
|
2014-08-04 18:07:55 -04:00
|
|
|
Then I should see "Content for B:Content B"
|
2014-08-04 17:41:22 -04:00
|
|
|
|
2012-08-16 16:48:34 -04:00
|
|
|
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:
|
2014-08-14 13:14:26 -04:00
|
|
|
@mixin global-reset {
|
|
|
|
html, body, div {
|
|
|
|
padding: 0;
|
|
|
|
}
|
|
|
|
}
|
2012-08-16 16:48:34 -04:00
|
|
|
@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:
|
2014-08-14 13:14:26 -04:00
|
|
|
html, body, div
|
|
|
|
padding: 0
|
2012-08-16 16:48:34 -04:00
|
|
|
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:
|
2014-08-14 13:14:26 -04:00
|
|
|
+global-reset2
|
2012-08-16 16:48:34 -04:00
|
|
|
body
|
|
|
|
h1 Welcome to Slim
|
|
|
|
"""
|
2020-06-15 14:19:39 -04:00
|
|
|
And the Server is running
|
2012-08-16 16:48:34 -04:00
|
|
|
When I go to "/scss.html"
|
2014-08-14 13:14:26 -04:00
|
|
|
Then I should see "html,body,div"
|
2012-08-16 16:48:34 -04:00
|
|
|
When I go to "/sass.html"
|
2014-08-14 13:14:26 -04:00
|
|
|
Then I should see "html,body,div"
|
2012-08-16 16:48:34 -04:00
|
|
|
When I go to "/error.html"
|
2015-09-28 14:24:37 -04:00
|
|
|
Then I should see "Error:"
|