Module: RspecExtensions::GetMessagePart
- Defined in:
- lib/rspec_tapas/get_message_part.rb
Instance Method Summary collapse
Instance Method Details
#get_message_part(mail, content_type) ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'lib/rspec_tapas/get_message_part.rb', line 3 def (mail, content_type) is_multipart = mail.body.parts.present? if is_multipart mail.body.parts.detect { |part| part.content_type.match(content_type) }.body.raw_source else mail.body.raw_source end end |
#html_part(mail) ⇒ Object
12 13 14 |
# File 'lib/rspec_tapas/get_message_part.rb', line 12 def html_part(mail) (mail, /html/) end |
#text_part(mail) ⇒ Object
16 17 18 |
# File 'lib/rspec_tapas/get_message_part.rb', line 16 def text_part(mail) (mail, /plain/) end |