I'm trying out email_spec, which says it supports Pony, but I'm not sure how I'd go about testing emails in a sinatra app. The examples in the readme show usages with rails ActionMailer
, but not in Pony.
Not precious about using email_spec, so any other ideas for testing emails using rspec in sinatra are welcomed =)
I haven't used email_spec before, but it looks pretty cool.
You can see how I test pony in the spec file, which may work for your case:
https://github.com/benprew/pony/blob/master/spec/pony_spec.rb
Also, you can deliver messages via :test, and it will use the test mailer included with mail:
See "Using Mail with Testing or Spec'ing Libraries" at https://github.com/mikel/mail for an example of examining the test messages.
I ended up looking at the pony spec file, and stealing code from it to write my specs =)
This is what I have:
./spec/spec_helper.rb
./spec/integration/invite_user_spec.rb