Cucumber updates (trying to get render to work.. no luck!)
This commit is contained in:
parent
1e1d276ed4
commit
e31512dd97
@ -3,16 +3,15 @@ Feature: Engine
|
||||
I want to be able to view someones created locomotive pages
|
||||
|
||||
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
|
||||
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
|
||||
"""
|
||||
When I render "/hello_world"
|
||||
Then output should look like
|
||||
When I view the rendered page at "/hello-world"
|
||||
Then the rendered output should look like:
|
||||
"""
|
||||
Hello World
|
||||
"""
|
||||
@ -32,7 +31,7 @@ Feature: Engine
|
||||
"""
|
||||
|
||||
When I render "/hello_world_layout"
|
||||
Then output should look like
|
||||
Then the rendered output should look like:
|
||||
"""
|
||||
<div class="up_above"></div>
|
||||
Hello World
|
||||
|
@ -4,7 +4,6 @@ Given /^I am not authenticated$/ do
|
||||
visit('/admin/sign_out')
|
||||
end
|
||||
|
||||
|
||||
Given /^I am an authenticated user$/ do
|
||||
Given %{I go to login}
|
||||
And %{I fill in "Email" with "admin@locomotiveapp.org"}
|
||||
@ -19,16 +18,6 @@ Then /^I am redirected to "([^\"]*)"$/ do |url|
|
||||
visit location
|
||||
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
|
||||
|
||||
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>
|
||||
</body>
|
||||
</html>})
|
||||
Factory(:layout, :site => @site)
|
||||
end
|
||||
|
@ -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
|
20
features/step_definitions/page_steps.rb
Normal file
20
features/step_definitions/page_steps.rb
Normal 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
|
Loading…
Reference in New Issue
Block a user