Completed the cucumbet feature for the front end inline editor.

This commit is contained in:
Mario Visic 2011-09-03 22:37:08 +08:00
parent d586d0eff4
commit 3113fbc9f0
2 changed files with 16 additions and 6 deletions

View File

@ -13,14 +13,13 @@ Feature: Engine
""" """
<html> <html>
<head>{% inline_editor %}</head> <head>{% inline_editor %}</head>
<body>{% editable_short_text 'a_sentence' %} owns this website{% endeditable_short_text %}</body> <body>{% editable_short_text 'owner' %}Tom{% endeditable_short_text %} owns this website</body>
</html> </html>
""" """
When I view the rendered page at "/about" When I view the rendered page at "/about"
Then I should see "edit" Then I should see "edit"
When I follow "edit" When I follow "edit"
And I type the content "Mario" into the first editable short field And I type the content "Mario" into the first editable field
And I press "save" And I follow "save"
When I view the rendered page at "/about" And I view the rendered page at "/about"
Then I should see "Mario owns this website" Then I should see "Mario owns this website"

View File

@ -10,4 +10,15 @@ Given /^the editable element "([^"]*)" for the "([^"]*)" block in the "([^"]*)"
page = @site.pages.where(:slug => page_slug).first page = @site.pages.where(:slug => page_slug).first
page.find_editable_element(block, slug).content = content page.find_editable_element(block, slug).content = content
page.save! page.save!
end 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