Skip to content

Instantly share code, notes, and snippets.

@sega
Created September 28, 2010 13:03
Show Gist options
  • Save sega/600944 to your computer and use it in GitHub Desktop.
Save sega/600944 to your computer and use it in GitHub Desktop.
# When I post the following to /api/send_money:
# | Recipient | Sebastian |
# | Amount | 7777 |
When /^I post the following to ([^:]+):$/ do |uri, fields|
# yes, i'd prefer to fold
params = {}
fields.rows_hash.each do |key, value|
params.merge!( { key => value } )
end
# params.do_some marvelous_transformations!
post uri, parameters
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment