Skip to content

Instantly share code, notes, and snippets.

@guilherme
Created February 5, 2012 19:53
Show Gist options
  • Save guilherme/1747696 to your computer and use it in GitHub Desktop.
Save guilherme/1747696 to your computer and use it in GitHub Desktop.
bookmailer test.
# application.rb
to(:tag, "put") do
subject = request.subject
title,url = subject.split(' ').map { |x| x.strip }
note = request.body
params = { :title => title, :url => url, :note => note }
bookmarks.add_bookmark(params)
respond :subject => "Bookmark saved #{title}"
end
default do
p request.from
p request.subject
p request.to
p request.body.to_s
respond :subject => "FAIL"
end
# debug
["[email protected]"]
"mendicant http://mendicantuniversity.org"
["[email protected]"]
"good place to learn."
# The response: FAIL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment