Follow-up from "Expose metrics dashboard url for graphql alert"
The following discussion from !35293 (merged) should be addressed:
-
@ck3g started a discussion: (+2 comments) should we update the description here as well?
This method can have non
nil
cases, should we have tests covering that?To make it shorter than the similar tests in
AlertPresenter
, we can define a new trait:with_metrics
inspec/factories/alert_management/alert.rb
to fill in required fields, and then use it here:let_it_be(:alert) do create(:alert_management_alert, :prometheus, :with_metrics, project: project, payload: prometheus_payload) end # ... expect(presenter.metrics_dashboard_url).to eq('https://dashboard-url')