Skip to content

Instantly share code, notes, and snippets.

@pnomolos
Last active April 6, 2016 18:21
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 pnomolos/df58340a9c019344206e07269b3ef104 to your computer and use it in GitHub Desktop.
Save pnomolos/df58340a9c019344206e07269b3ef104 to your computer and use it in GitHub Desktop.
# If you're sending html-only mail (Shame on you! 😆) you can use the following so you get support for
# it { should have_sent_email.matching_html_part(/html-only contents/) }
module Mail
module Matchers
class HasSentEmailMatcher
def matching_html_part(html_part_matcher)
@html_part_matcher = html_part_matcher
self
end
def matches_on_html_part_matcher?(delivery)
@html_part_matcher.match delivery.html_part.raw_source
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment