Cleaning up Engine Specs

This commit is contained in:
Jacques Crocker 2010-08-16 14:26:15 -07:00
parent 08f0fdfb5b
commit b0e21c2375
2 changed files with 84 additions and 81 deletions

View File

@ -5,91 +5,59 @@ Feature: Engine
Background:
Given I have the site: "test site" set up
# Scenario: Simple Page
# Given a page named "hello-world" with the template:
# """
# Hello World
# """
# When I view the rendered page at "/hello-world"
# Then the rendered output should look like:
# """
# Hello World
# """
#
# Scenario: Simple Page extending a layout with multiple blocks
# Given a layout named "layout_with_sidebar" with the source:
# """
# <div class="header"></div>
# <div class="content">
# <div class="sidebar">{% block sidebar %}DEFAULT SIDEBAR CONTENT{% endblock %}</div>
# <div class="body">
# {% block body %}DEFAULT BODY CONTENT{% endblock %}
# </div>
# </div>
# <div class="footer"></div>
# """
# And a page named "hello-world-multiblocks" with the template:
# """
# {% extends 'layout_with_sidebar' %}
# {% block body %}Hello world{% endblock %}
# """
# When I view the rendered page at "/hello-world-multiblocks"
# Then the rendered output should look like:
# """
# <div class="header"></div>
# <div class="content">
# <div class="sidebar">DEFAULT SIDEBAR CONTENT</div>
# <div class="body">
# Hello world
# </div>
# </div>
# <div class="footer"></div>
# """
Scenario: Simple Page
Given a page named "hello-world" with the template:
"""
Hello World
"""
When I view the rendered page at "/hello-world"
Then the rendered output should look like:
"""
Hello World
"""
# Scenario: Simple Page extending a layout with multiple blocks which extends another template
# Given a layout named "layout_with_sidebar" with the source:
# """
# <div class="header"></div>
# <div class="content">
# <div class="sidebar">{% block sidebar %}DEFAULT SIDEBAR CONTENT{% endblock %}</div>
# <div class="body">
# {% block body %}DEFAULT BODY CONTENT{% endblock %}
# </div>
# </div>
# <div class="footer"></div>
# """
# And a layout named "custom_layout_with_sidebar" with the source:
# """
# {% extends 'layout_with_sidebar' %}
# {% block sidebar %}Custom sidebar{% endblock %}
# {% block body %}Hello{% endblock %}
# """
# And a page named "hello-world-multiblocks" with the template:
# """
# {% extends 'custom_layout_with_sidebar' %}
# {% block body %}{{ block.super }} world{% endblock %}
# """
# When I view the rendered page at "/hello-world-multiblocks"
# Then the rendered output should look like:
# """
# <div class="header"></div>
# <div class="content">
# <div class="sidebar">Custom sidebar</div>
# <div class="body">
# Hello world
# </div>
# </div>
# <div class="footer"></div>
# """
Scenario: Page extending a layout with multiple blocks
Given a layout named "layout_with_sidebar" with the source:
"""
<div class="header"></div>
<div class="content">
<div class="sidebar">
{% block sidebar %}DEFAULT SIDEBAR CONTENT{% endblock %}
</div>
<div class="body">
{% block body %}DEFAULT BODY CONTENT{% endblock %}
</div>
</div>
<div class="footer"></div>
"""
And a page named "hello-world-multiblocks" with the template:
"""
{% extends 'layout_with_sidebar' %}
{% block body %}Hello world{% endblock %}
"""
When I view the rendered page at "/hello-world-multiblocks"
Then the rendered output should look like:
"""
<div class="header"></div>
<div class="content">
<div class="sidebar">
DEFAULT SIDEBAR CONTENT
</div>
<div class="body">
Hello world
</div>
</div>
<div class="footer"></div>
"""
Scenario: Simple Page extending a layout with multiple embedded blocks which extends another template
Scenario: Page extending a layout with multiple blocks which extends another template
Given a layout named "layout_with_sidebar" with the source:
"""
<div class="header"></div>
<div class="content">
<div class="sidebar">{% block sidebar %}DEFAULT SIDEBAR CONTENT{% endblock %}</div>
<div class="body">
{% block body %}Hello{% endblock %}
{% block body %}DEFAULT BODY CONTENT{% endblock %}
</div>
</div>
<div class="footer"></div>
@ -97,21 +65,22 @@ Scenario: Simple Page extending a layout with multiple embedded blocks which ext
And a layout named "custom_layout_with_sidebar" with the source:
"""
{% extends 'layout_with_sidebar' %}
{% block body %}{{ block.super }} {% block main %}mister{% endblock %}{% endblock %}
{% block sidebar %}Custom sidebar{% endblock %}
{% block body %}Hello{% endblock %}
"""
And a page named "hello-world-multiblocks" with the template:
"""
{% extends 'custom_layout_with_sidebar' %}
{% block main %}{{ block.super }} Jacques{% endblock %}
{% block body %}{{ block.super }} world{% endblock %}
"""
When I view the rendered page at "/hello-world-multiblocks"
Then the rendered output should look like:
"""
<div class="header"></div>
<div class="content">
<div class="sidebar">DEFAULT SIDEBAR CONTENT</div>
<div class="sidebar">Custom sidebar</div>
<div class="body">
Hello mister Jacques
Hello world
</div>
</div>
<div class="footer"></div>

View File

@ -0,0 +1,34 @@
Scenario: Simple Page extending a layout with multiple embedded blocks which extends another template
Given a layout named "layout_with_sidebar" with the source:
"""
<div class="header"></div>
<div class="content">
<div class="sidebar">{% block sidebar %}DEFAULT SIDEBAR CONTENT{% endblock %}</div>
<div class="body">
{% block body %}Hello{% endblock %}
</div>
</div>
<div class="footer"></div>
"""
And a layout named "custom_layout_with_sidebar" with the source:
"""
{% extends 'layout_with_sidebar' %}
{% block body %}{{ block.super }} {% block main %}mister{% endblock %}{% endblock %}
"""
And a page named "hello-world-multiblocks" with the template:
"""
{% extends 'custom_layout_with_sidebar' %}
{% block main %}{{ block.super }} Jacques{% endblock %}
"""
When I view the rendered page at "/hello-world-multiblocks"
Then the rendered output should look like:
"""
<div class="header"></div>
<div class="content">
<div class="sidebar">DEFAULT SIDEBAR CONTENT</div>
<div class="body">
Hello mister Jacques
</div>
</div>
<div class="footer"></div>
"""