2011-06-02 13:15:11 +00:00
|
|
|
Feature: Snippets
|
|
|
|
In order to manage snippets
|
|
|
|
As an administrator
|
|
|
|
I want to add/edit/delete snippets of my site
|
|
|
|
|
|
|
|
Background:
|
|
|
|
Given I have the site: "test site" set up
|
|
|
|
And I am an authenticated user
|
2011-07-22 23:26:16 +00:00
|
|
|
And a page named "home" with the template:
|
2011-06-02 13:36:03 +00:00
|
|
|
"""
|
|
|
|
{% include 'yield' %}
|
|
|
|
"""
|
2011-07-22 23:26:16 +00:00
|
|
|
And a snippet named "yield" with the template:
|
2011-06-02 13:36:03 +00:00
|
|
|
"""
|
|
|
|
"yield"
|
|
|
|
"""
|
2011-06-02 13:58:17 +00:00
|
|
|
|
2011-06-02 14:01:25 +00:00
|
|
|
|
|
|
|
Scenario: Creating a Snippet
|
|
|
|
When I go to theme assets
|
|
|
|
And I follow "new snippet"
|
|
|
|
And I fill in "Name" with "Banner"
|
|
|
|
And I fill in "Slug" with "banner"
|
|
|
|
And I fill in "snippet_template" with "banner"
|
|
|
|
And I press "Create"
|
|
|
|
Then I should see "Snippet was successfully created."
|
|
|
|
And I should have "banner" in the banner snippet
|
|
|
|
|
2011-06-02 13:58:17 +00:00
|
|
|
Scenario: Updating a Snippet that includes another snippet
|
2011-07-22 23:26:16 +00:00
|
|
|
Given a snippet named "other" with the template:
|
2011-06-02 13:36:03 +00:00
|
|
|
"""
|
|
|
|
"other"
|
|
|
|
"""
|
2011-06-02 13:15:11 +00:00
|
|
|
When I go to theme assets
|
|
|
|
And I follow "yield"
|
|
|
|
And I fill in "snippet_template" with "{% include 'other' %}"
|
2011-07-22 23:26:16 +00:00
|
|
|
And I press "Save"
|
2011-06-02 13:15:11 +00:00
|
|
|
Then I should see "Snippet was successfully updated."
|
|
|
|
And I should have "{% include 'other' %}" in the yield snippet
|