Commit 08216066 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Log more information about the inbox while waiting

parent 5059c8bd
...@@ -26,7 +26,7 @@ module QA ...@@ -26,7 +26,7 @@ module QA
mailhog_items = mailhog_json.dig('items') 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 end
private private
...@@ -38,10 +38,21 @@ module QA ...@@ -38,10 +38,21 @@ module QA
mailhog_response = get QA::Runtime::MailHog.api_messages_url mailhog_response = get QA::Runtime::MailHog.api_messages_url
mailhog_data = JSON.parse(mailhog_response.body) 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 # Expect at least two invitation messages: group and project
mailhog_data if mailhog_data.dig('total') >= 2 mailhog_data if total >= 2
end
end end
def mailhog_item_subject(item)
item.dig('Content', 'Headers', 'Subject', 0)
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment