vendor/refinerycms/pages/features/step_definitions/page_steps.rb in refinerycms-0.9.8.5 vs vendor/refinerycms/pages/features/step_definitions/page_steps.rb in refinerycms-0.9.8.6

- old
+ new

@@ -1,28 +1,44 @@ -Given /^I (only )?have a page titled "([^"]*)" with a custom url "([^"]*)"?$/ do |only, title, link_url| +Given /^I (only )?have a page titled "?([^\"]*)"? with a custom url "?([^\"]*)"?$/ do |only, title, link_url| Page.delete_all if only Page.create(:title => title, :link_url => link_url) end -Given /^I (only )?have pages titled "?([^"]*)"?$/ do |only, titles| +Given /^the page titled "?([^\"]*)"? has a menu match "?([^\"]*)"?$/ do |title, menu_match| + Page.find_by_title(title).update_attribute(:menu_match, menu_match) +end + +Given /^I (only )?have pages titled "?([^\"]*)"?$/ do |only, titles| Page.delete_all if only titles.split(', ').each do |title| Page.create(:title => title) end end Given /^I have no pages$/ do Page.delete_all end -Given /^I (only )?have a page titled "([^"]*)"$/ do |only, title| +Given /^I (only )?have a page titled "?([^\"]*)"?$/ do |only, title| Page.delete_all if only PagePart.delete_all if only page = Page.create(:title => title) page.parts << PagePart.new(:title => 'testing', :position => 0) page +end + +Given /^the page titled "?([^\"]*)"? is a child of "?([^\"]*)"?$/ do |title, parent_title| + Page.find_by_title(title).update_attribute(:parent, Page.find_by_title(parent_title)) +end + +Given /^the page titled "?([^\"]*)"? is not shown in the menu$/ do |title| + Page.find_by_title(title).update_attribute(:show_in_menu, false) +end + +Given /^the page titled "?([^\"]*)"? is draft$/ do |title| + Page.find_by_title(title).update_attribute(:draft, true) end Then /^I should have ([0-9]+) pages?$/ do |count| Page.count.should == count.to_i end