Fix RSpec/FeatureCategory in _ee_subscribable_banner.html.haml_spec

What does this MR do and why?

ee/spec/views/layouts/header/_ee_subscribable_banner.html.haml_spec.rb declared no feature_category:, so RSpec/FeatureCategory rejects it. This MR sets feature_category: :consumables_cost_management.

The change is metadata on the top-level RSpec.describe. No example body changes, and no test behaviour changes.

.rubocop_todo/rspec/feature_category.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.

Design decisions

:consumables_cost_management is a judgment call rather than a value copied from an authoritative source, so please confirm it is the right category before merging. Neither derived source was available:

  • The class under test: ee/app/views/layouts/header/_ee_subscribable_banner.html.haml is a HAML partial, so it declares no category of its own. Its helper, ee/app/helpers/ee/subscribable_banner_helper.rb, has none either, and neither does its spec.
  • Sibling specs: the only other spec in the directory, _read_only_banner.html.haml_spec.rb, also declares no category, so there is no consensus to copy.

That leaves the spec's own content. It renders the license or subscription expiry banner and checks the renew, upgrade and dismiss actions. ee/spec/features/admin/groups/admin_subscription_alerts_spec.rb already exercises this same banner (through the subscribable_banner test id) under :consumables_cost_management, so I matched it. The alternatives I considered are :subscription_management, which fits the "Renew subscription" wording, and :plan_provisioning, which License and LicenseMonitoringHelper use.

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.

  1. Confirm the cop is satisfied on this branch, which should report no offenses
REVEAL_RUBOCOP_TODO=1 bundle exec rubocop --only RSpec/FeatureCategory ee/spec/views/layouts/header/_ee_subscribable_banner.html.haml_spec.rb
  1. Confirm the new value is a real category, which should print the matching line
grep -x -- '- consumables_cost_management' config/feature_categories.yml
  1. Confirm the file still offends on master, so the check above is meaningful. This should report the offense this MR removes
git show master:ee/spec/views/layouts/header/_ee_subscribable_banner.html.haml_spec.rb | REVEAL_RUBOCOP_TODO=1 bundle exec rubocop --only RSpec/FeatureCategory --stdin ee/spec/views/layouts/header/_ee_subscribable_banner.html.haml_spec.rb

References

Merge request reports

Loading
Loading