Cucumber updates (trying to get render to work.. no luck!)

This commit is contained in:
Jacques Crocker 2010-08-01 04:14:00 -07:00
parent 1e1d276ed4
commit e31512dd97
4 changed files with 25 additions and 22 deletions

View File

@ -3,16 +3,15 @@ Feature: Engine
I want to be able to view someones created locomotive pages I want to be able to view someones created locomotive pages
Background: Background:
Given I have the site: "test site" set up with name: "Something2111" Given I have the site: "test site" set up
@wip
Scenario: Simple Page Scenario: Simple Page
Given I have a page created at "/hello_world" with the content: Given I have a simple page created at "hello-world" with the body:
""" """
Hello World Hello World
""" """
When I render "/hello_world" When I view the rendered page at "/hello-world"
Then output should look like Then the rendered output should look like:
""" """
Hello World Hello World
""" """
@ -32,7 +31,7 @@ Feature: Engine
""" """
When I render "/hello_world_layout" When I render "/hello_world_layout"
Then output should look like Then the rendered output should look like:
""" """
<div class="up_above"></div> <div class="up_above"></div>
Hello World Hello World

View File

@ -4,7 +4,6 @@ Given /^I am not authenticated$/ do
visit('/admin/sign_out') visit('/admin/sign_out')
end end
Given /^I am an authenticated user$/ do Given /^I am an authenticated user$/ do
Given %{I go to login} Given %{I go to login}
And %{I fill in "Email" with "admin@locomotiveapp.org"} And %{I fill in "Email" with "admin@locomotiveapp.org"}
@ -19,16 +18,6 @@ Then /^I am redirected to "([^\"]*)"$/ do |url|
visit location visit location
end end
### Pages
Then /^I should have "(.*)" in the (.*) page (.*)$/ do |content, page_slug, slug|
page = @site.pages.where(:slug => page_slug).first
part = page.parts.where(:slug => slug).first
part.should_not be_nil
part.value.should == content
end
### Cross-domain authentication ### Cross-domain authentication
When /^I forget to press the button on the cross-domain notice page$/ do When /^I forget to press the button on the cross-domain notice page$/ do
@ -47,5 +36,4 @@ def create_layout_samples
<div id="main">{{ content_for_layout }}</div> <div id="main">{{ content_for_layout }}</div>
</body> </body>
</html>}) </html>})
Factory(:layout, :site => @site)
end end

View File

@ -1,4 +0,0 @@
Given /^I have a page created at "([^"]*)" with the content:$/ do |page, page_contents|
pending # express the regexp above with the code you wish you had
end

View File

@ -0,0 +1,20 @@
### Pages
Given /^I have a simple page created at "([^"]*)" with the body:$/ do |slug, page_contents|
@page = Factory(:page, :site => @site, :slug => slug, :body => page_contents)
end
When /^I view the rendered page at "([^"]*)"$/ do |slug|
visit "/#{slug}"
end
Then /^I should have "(.*)" in the (.*) page (.*)$/ do |content, page_slug, slug|
page = @site.pages.where(:slug => page_slug).first
part = page.parts.where(:slug => slug).first
part.should_not be_nil
part.value.should == content
end
Then /^the rendered output should look like:$/ do |body_contents|
page.body.should == body_contents
end