engine/features/step_definitions/editable_elements_steps.rb
2011-09-01 18:45:30 +08:00

13 lines
587 B
Ruby

# modify an editable element
Given /^the editable element "([^"]*)" in the "([^"]*)" page with the content "([^"]*)"$/ do |slug, page_slug, content|
page = @site.pages.where(:slug => page_slug).first
page.find_editable_element(nil, slug).content = content
page.save!
end
# modify an editable element
Given /^the editable element "([^"]*)" for the "([^"]*)" block in the "([^"]*)" page with the content "([^"]*)"$/ do |slug, block, page_slug, content|
page = @site.pages.where(:slug => page_slug).first
page.find_editable_element(block, slug).content = content
page.save!
end