summaryrefslogtreecommitdiff
path: root/spec/support/matchers/email_matcher.rb
blob: 36cf3e0e871b58807116bd113fc22ee584232d77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

RSpec::Matchers.define :have_text_part_content do |expected|
  match do |actual|
    @actual = actual.text_part.body.to_s
    expect(@actual).to include(expected)
  end

  diffable
end

RSpec::Matchers.define :have_html_part_content do |expected|
  match do |actual|
    @actual = actual.html_part.body.to_s
    expect(@actual).to include(expected)
  end

  diffable
end