Skip to content

Instantly share code, notes, and snippets.

@chromeragnarok
Created September 16, 2011 12:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chromeragnarok/1222029 to your computer and use it in GitHub Desktop.
Save chromeragnarok/1222029 to your computer and use it in GitHub Desktop.
// JS Stuffs here
$("#add-new").droppable({
accept: ".draggable-stuffs",
drop: handleDrop
}).tipsy({title: 'data-tooltip'});
# some web steps to be called on your cukes...
When /^I drag room "([^"]*)" to the add-new zone$/ do |room_title|
javascript = <<-eos
var ui = { draggable: $("#{room_div_id}")};
handleAddNewDrop($.Event("drop"), ui);
eos
page.execute_script javascript
end
When /^I change the group\-box number (\d+) title to "([^"]*)"$/ do |order, new_title|
javascript = <<-eos
var selectedGroupBox = $($(".group-box")[#{order}]);
selectedGroupBox.find(".edit").click();
selectedGroupBox.find("input").val("#{new_title}");
selectedGroupBox.find("input").blur();
eos
page.execute_script javascript
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment