Skip to content

Instantly share code, notes, and snippets.

@joemsak
Created February 17, 2010 17:23
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 joemsak/306830 to your computer and use it in GitHub Desktop.
Save joemsak/306830 to your computer and use it in GitHub Desktop.
When /^I add a new booking with:$/ do |table|
booking_info = table.hashes.first
visit new_booking_path
booking_info.each do |field, value|
if field == 'Start Date' || field == 'End Date'
fill_in(field, :with => value)
elsif field != 'Contractors'
select(value, :from => field)
else
check(value)
end
end
click_button "Submit"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment