Skip to content

Rails 5: fix presence message validation for prometheus_alert

What does this MR do?

Rails 5 changed the required message validation from "can't be blank" to "must exist". See https://github.com/rails/rails/pull/18700 and https://github.com/thoughtbot/shoulda-matchers/issues/861. This check can be replaced by is_expected.to belong_to(:prometheus_alert).required in version 4.x of shoulda-matchers but that version is unreleased yet.

Fixes ee/spec/models/prometheus_alert_event_spec.rb:16. See https://gitlab.com/gitlab-org/gitlab-ee/-/jobs/104963302.

What are the relevant issue numbers?

Does this MR meet the acceptance criteria?

Edited by Rémy Coutable

Merge request reports