2010-08-24 22:59:22 +00:00
|
|
|
# modify an editable element
|
2010-08-26 11:06:44 +00:00
|
|
|
Given /^the editable element "([^"]*)" in the "([^"]*)" page with the content "([^"]*)"$/ do |slug, page_slug, content|
|
2010-08-24 22:59:22 +00:00
|
|
|
page = @site.pages.where(:slug => page_slug).first
|
|
|
|
page.find_editable_element(nil, slug).content = content
|
|
|
|
page.save!
|
2010-08-26 11:06:44 +00:00
|
|
|
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!
|
2011-09-03 14:37:08 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
When /^I type the content "([^"]*)" into the first editable field$/ do |content|
|
|
|
|
page.execute_script %{
|
|
|
|
$(document).ready(function() {
|
|
|
|
editable = GENTICS.Aloha.editables[0];
|
|
|
|
editable.obj.text('#{content}');
|
|
|
|
editable.blur();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|