summaryrefslogtreecommitdiff
path: root/qa/qa/specs/features/browser_ui/2_plan/email/trigger_email_notification_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/specs/features/browser_ui/2_plan/email/trigger_email_notification_spec.rb')
-rw-r--r--qa/qa/specs/features/browser_ui/2_plan/email/trigger_email_notification_spec.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/qa/qa/specs/features/browser_ui/2_plan/email/trigger_email_notification_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/email/trigger_email_notification_spec.rb
index 3717bc8a9ff..a334731386a 100644
--- a/qa/qa/specs/features/browser_ui/2_plan/email/trigger_email_notification_spec.rb
+++ b/qa/qa/specs/features/browser_ui/2_plan/email/trigger_email_notification_spec.rb
@@ -26,7 +26,7 @@ module QA
mailhog_items = mailhog_json.dig('items')
- expect(mailhog_items).to include(an_object_satisfying { |o| /project was granted/ === o.dig('Content', 'Headers', 'Subject', 0) })
+ expect(mailhog_items).to include(an_object_satisfying { |o| /project was granted/ === mailhog_item_subject(o) })
end
private
@@ -38,11 +38,22 @@ module QA
mailhog_response = get QA::Runtime::MailHog.api_messages_url
mailhog_data = JSON.parse(mailhog_response.body)
+ total = mailhog_data.dig('total')
+ subjects = mailhog_data.dig('items')
+ .map(&method(:mailhog_item_subject))
+ .join("\n")
+
+ Runtime::Logger.debug(%Q[Total number of emails: #{total}])
+ Runtime::Logger.debug(%Q[Subjects:\n#{subjects}])
# Expect at least two invitation messages: group and project
- mailhog_data if mailhog_data.dig('total') >= 2
+ mailhog_data if total >= 2
end
end
+
+ def mailhog_item_subject(item)
+ item.dig('Content', 'Headers', 'Subject', 0)
+ end
end
end
end