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: Background:
Given I have the site: "test site" set up Given I have the site: "test site" set up
# Scenario: Simple Page Scenario: Simple Page
# Given a page named "hello-world" with the template: Given a page named "hello-world" with the template:
# """ """
# Hello World Hello World
# """ """
# When I view the rendered page at "/hello-world" When I view the rendered page at "/hello-world"
# Then the rendered output should look like: Then the rendered output should look like:
# """ """
# Hello World 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 extending a layout with multiple blocks which extends another template Scenario: Page extending a layout with multiple blocks
# Given a layout named "layout_with_sidebar" with the source: Given a layout named "layout_with_sidebar" with the source:
# """ """
# <div class="header"></div> <div class="header"></div>
# <div class="content"> <div class="content">
# <div class="sidebar">{% block sidebar %}DEFAULT SIDEBAR CONTENT{% endblock %}</div> <div class="sidebar">
# <div class="body"> {% block sidebar %}DEFAULT SIDEBAR CONTENT{% endblock %}
# {% block body %}DEFAULT BODY CONTENT{% endblock %} </div>
# </div> <div class="body">
# </div> {% block body %}DEFAULT BODY CONTENT{% endblock %}
# <div class="footer"></div> </div>
# """ </div>
# And a layout named "custom_layout_with_sidebar" with the source: <div class="footer"></div>
# """ """
# {% extends 'layout_with_sidebar' %} And a page named "hello-world-multiblocks" with the template:
# {% block sidebar %}Custom sidebar{% endblock %} """
# {% block body %}Hello{% endblock %} {% extends 'layout_with_sidebar' %}
# """ {% block body %}Hello world{% endblock %}
# And a page named "hello-world-multiblocks" with the template: """
# """ When I view the rendered page at "/hello-world-multiblocks"
# {% extends 'custom_layout_with_sidebar' %} Then the rendered output should look like:
# {% block body %}{{ block.super }} world{% endblock %} """
# """ <div class="header"></div>
# When I view the rendered page at "/hello-world-multiblocks" <div class="content">
# Then the rendered output should look like: <div class="sidebar">
# """ DEFAULT SIDEBAR CONTENT
# <div class="header"></div> </div>
# <div class="content"> <div class="body">
# <div class="sidebar">Custom sidebar</div> Hello world
# <div class="body"> </div>
# Hello world </div>
# </div> <div class="footer"></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: Given a layout named "layout_with_sidebar" with the source:
""" """
<div class="header"></div> <div class="header"></div>
<div class="content"> <div class="content">
<div class="sidebar">{% block sidebar %}DEFAULT SIDEBAR CONTENT{% endblock %}</div> <div class="sidebar">{% block sidebar %}DEFAULT SIDEBAR CONTENT{% endblock %}</div>
<div class="body"> <div class="body">
{% block body %}Hello{% endblock %} {% block body %}DEFAULT BODY CONTENT{% endblock %}
</div> </div>
</div> </div>
<div class="footer"></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: And a layout named "custom_layout_with_sidebar" with the source:
""" """
{% extends 'layout_with_sidebar' %} {% 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: And a page named "hello-world-multiblocks" with the template:
""" """
{% extends 'custom_layout_with_sidebar' %} {% 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" When I view the rendered page at "/hello-world-multiblocks"
Then the rendered output should look like: Then the rendered output should look like:
""" """
<div class="header"></div> <div class="header"></div>
<div class="content"> <div class="content">
<div class="sidebar">DEFAULT SIDEBAR CONTENT</div> <div class="sidebar">Custom sidebar</div>
<div class="body"> <div class="body">
Hello mister Jacques Hello world
</div> </div>
</div> </div>
<div class="footer"></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>
"""