Add missing example descriptions in security_and_compliance.html.haml_spec
What does this MR do and why?
ee/spec/views/admin/application_settings/security_and_compliance.html.haml_spec.rb had 2 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.
ee/spec/views/admin/application_settings/security_and_compliance.html.haml_spec.rb:26, undershared_examples 'renders secret push protection setting':renders the secret detection settings sectionee/spec/views/admin/application_settings/security_and_compliance.html.haml_spec.rb:34, undershared_examples 'does not render secret push protection setting':does not render the secret detection settings section
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 ee/spec/views/admin/application_settings/security_and_compliance.html.haml_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:ee/spec/views/admin/application_settings/security_and_compliance.html.haml_spec.rb | REVEAL_RUBOCOP_TODO=1 bundle exec rubocop --only RSpec/ExampleWithoutDescription --stdin ee/spec/views/admin/application_settings/security_and_compliance.html.haml_spec.rbReferences
- Relates to #589138
- RSpec/ExampleWithoutDescription: https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspecexamplewithoutdescription