module GdsApi::TestHelpers::EmailAlertApi

def email_alert_api_has_notifications(notifications, start_at = nil)

def email_alert_api_has_notifications(notifications, start_at = nil)
  url = notifications_url
  url += "?start_at=#{start_at}" if start_at
  url_regexp = Regexp.new("^#{Regexp.escape(url)}$")
  stub_request(:get, url_regexp)
    .to_return(
      status: 200,
      body: notifications.to_json
    )
end