Woohoo! Got a content page to render in the Cucumber tests
This commit is contained in:
parent
e31512dd97
commit
2b14c9c992
@ -1,11 +1,11 @@
|
||||
### 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)
|
||||
@page = Factory("content page", :site => @site, :slug => slug, :body => page_contents)
|
||||
end
|
||||
|
||||
When /^I view the rendered page at "([^"]*)"$/ do |slug|
|
||||
visit "/#{slug}"
|
||||
visit "http://#{@site.domains.first}/#{slug}"
|
||||
end
|
||||
|
||||
Then /^I should have "(.*)" in the (.*) page (.*)$/ do |content, page_slug, slug|
|
||||
|
@ -1,4 +1,6 @@
|
||||
require 'database_cleaner'
|
||||
require 'database_cleaner/cucumber'
|
||||
Before do
|
||||
DatabaseCleaner.clean
|
||||
end
|
||||
DatabaseCleaner.strategy = :truncation
|
||||
DatabaseCleaner.orm = "mongoid"
|
@ -11,7 +11,6 @@ module Locomotive
|
||||
|
||||
# see actionpack/lib/action_dispatch/http/url.rb for more information
|
||||
def self.domain_and_subdomain(request)
|
||||
subdomain = extract_subdomain(request)
|
||||
[extract_domain(request), extract_subdomain(request)]
|
||||
end
|
||||
|
||||
|
@ -55,6 +55,12 @@ Factory.define :page do |p|
|
||||
p.site { Site.where(:subdomain => "acme").first || Factory(:site) }
|
||||
end
|
||||
|
||||
Factory.define "content page", :parent => :page do |p|
|
||||
p.parent { |p| p.site.pages.where(:slug => "index").first }
|
||||
end
|
||||
|
||||
|
||||
|
||||
# Factory.define "unpub"
|
||||
|
||||
## Liquid templates ##
|
||||
|
@ -20,13 +20,7 @@ Rspec.configure do |config|
|
||||
DatabaseCleaner.strategy = :truncation
|
||||
DatabaseCleaner.orm = "mongoid"
|
||||
end
|
||||
|
||||
config.before(:each) do
|
||||
DatabaseCleaner.start
|
||||
end
|
||||
|
||||
config.after(:each) do
|
||||
DatabaseCleaner.clean
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user