Commit e3e6c774 authored by Dan Davison's avatar Dan Davison

Merge branch 'simplify_trigger_email_notification_test' into 'master'

Simplify trigger email notification test

See merge request gitlab-org/gitlab!22897
parents e99dc6b2 5c0e3b5e
......@@ -22,8 +22,15 @@ module QA
expect(page).to have_content(/@#{user.username}(\n| )?Given access/)
# Wait for Action Mailer to deliver messages
mailhog_json = Support::Retrier.retry_until(sleep_interval: 1) do
mailhog_items = mailhog_json.dig('items')
expect(mailhog_items).to include(an_object_satisfying { |o| /project was granted/ === o.dig('Content', 'Headers', 'Subject', 0) })
end
private
def mailhog_json
Support::Retrier.retry_until(sleep_interval: 1) do
Runtime::Logger.debug(%Q[retrieving "#{QA::Runtime::MailHog.api_messages_url}"])
mailhog_response = get QA::Runtime::MailHog.api_messages_url
......@@ -33,10 +40,6 @@ module QA
# Expect at least two invitation messages: group and project
mailhog_data if mailhog_data.dig('total') >= 2
end
# Check json result from mailhog
mailhog_items = mailhog_json.dig('items')
expect(mailhog_items).to include(an_object_satisfying { |o| /project was granted/ === o.dig('Content', 'Headers', 'Subject', 0) })
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