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>
<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>
"""
When I view the rendered page at "/about"
Then I should see "edit"
When I follow "edit"
And I type the content "Mario" into the first editable short field
And I press "save"
When I view the rendered page at "/about"
And I type the content "Mario" into the first editable field
And I follow "save"
And I view the rendered page at "/about"
Then I should see "Mario owns this website"

View File

@ -11,3 +11,14 @@ Given /^the editable element "([^"]*)" for the "([^"]*)" block in the "([^"]*)"
page.find_editable_element(block, slug).content = content
page.save!
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