Add missing example descriptions in http_integration_spec
What does this MR do and why?
spec/models/alert_management/http_integration_spec.rb had 6 multi-line examples with no description, so RSpec generated one from the matcher and RSpec/ExampleWithoutDescription flagged them. This MR gives each one a description.
The change is one string argument per it. The example bodies are untouched, and no test behaviour changes.
spec/models/alert_management/http_integration_spec.rb:57, undervalidations>payload_attribute_mapping>with invalid JSON schema> shared examplesis invalid record:is invalid with a json schema error on payload_attribute_mappingspec/models/alert_management/http_integration_spec.rb:257, under#url:returns the http integration url with the name slugspec/models/alert_management/http_integration_spec.rb:271, under#url>when name is not defined:returns the http integration url with the default http-endpoint slugspec/models/alert_management/http_integration_spec.rb:286, under#url>for a legacy integration:returns the alerts notify urlspec/models/alert_management/http_integration_spec.rb:299, under#url>for a prometheus integration:returns the http integration url with the name slugspec/models/alert_management/http_integration_spec.rb:313, under#url>for a prometheus integration>for a legacy integration:returns the prometheus alerts notify url
RuboCop can check that a description exists, but not that it is true, and neither can the pipeline. Please read each one against the body it sits above.
.rubocop_todo/rspec/example_without_description.yml still lists this file. The entry is redundant now, and the scheduled Keeps::GenerateRubocopTodos run regenerates the todo files from a full rescan and drops entries whose offense is gone.
How to set up and validate locally
The file is still listed in the RuboCop todo, so a plain rubocop run reports no offenses whether or not this change is correct. REVEAL_RUBOCOP_TODO=1 is what makes the cop see it, which is why the pipeline cannot show this and a local run can.
- Confirm the cop is satisfied on this branch, which should report no offenses
REVEAL_RUBOCOP_TODO=1 bundle exec rubocop --only RSpec/ExampleWithoutDescription spec/models/alert_management/http_integration_spec.rb- Confirm the file still offends on
master, so the check above is meaningful. This should report the offenses this MR removes
git show master:spec/models/alert_management/http_integration_spec.rb | REVEAL_RUBOCOP_TODO=1 bundle exec rubocop --only RSpec/ExampleWithoutDescription --stdin spec/models/alert_management/http_integration_spec.rbReferences
- Relates to #589138
- RSpec/ExampleWithoutDescription: https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspecexamplewithoutdescription