Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/matchers/email_matcher.rb')
-rw-r--r--spec/support/matchers/email_matcher.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/support/matchers/email_matcher.rb b/spec/support/matchers/email_matcher.rb
new file mode 100644
index 00000000000..36cf3e0e871
--- /dev/null
+++ b/spec/support/matchers/email_matcher.rb
@@ -0,0 +1,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