Skip to content

Instantly share code, notes, and snippets.

@patcoll
Created July 21, 2010 00:43
Show Gist options
  • Save patcoll/483862 to your computer and use it in GitHub Desktop.
Save patcoll/483862 to your computer and use it in GitHub Desktop.
Then /^I should be able to change the "(name|teaser_text|full_text)" of the ad with an inline editor$/ do |field|
require 'time'
selector = ".inline-edit em.text .#{field}"
old_value = find(selector).text
value = "New Value #{Time.now.to_i}"
find(selector).click
wait_until { find_field(field) }
fill_in(field, :with => value)
click_button("Save")
wait_until { find(selector).text == value }
find(selector).click
wait_until { find_field(field) }
fill_in(field, :with => old_value)
click_button("Save")
wait_until { find(selector).text == old_value }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment