Skip to content

style: replace have_no_selector with have_no_css in stats specs - #3065

Merged
mroderick merged 1 commit into
masterfrom
style/have-no-css-matchers
Oct 30, 2026
Merged

mroderick merged 1 commit into
masterfrom
style/have-no-css-matchers

Conversation

@mroderick

Copy link
Copy Markdown
Collaborator

Pre-clears the RuboCop failure on #3063 so that PR can stay dependency-only.

Problem

rubocop-capybara 3.1.0 (part of the ruby-deps group bump in #3063) teaches Capybara/RSpec/HaveSelector to detect have_no_selector. Six existing calls in the stats specs then fail the RuboCop check. The same six calls are invisible to 3.0.0, which master pins, so master stays green either way.

Change

Replace have_no_selector with have_no_css at the six flagged lines in spec/features/admin/stats_page_spec.rb and spec/components/admin/stats/table_component_spec.rb. Capybara 3.40 defines both matchers through the same negation loop and its default selector is :css, so the matcher resolves to the same check. These are the replacements rubocop-capybara's own autocorrect produces.

Review notes

Capybara's default selector is :css, so have_no_css is the explicit
form of have_no_selector for these CSS selectors and behaviour does
not change. rubocop-capybara 3.1.0 teaches
Capybara/RSpec/HaveSelector to detect have_no_selector, which flags
these six lines; landing the correction ahead of the ruby-deps
group bump keeps that PR to dependencies alone.
@mroderick
mroderick marked this pull request as ready for review October 30, 2026 08:09
@mroderick
mroderick merged commit ab013a2 into master Oct 30, 2026
12 checks passed
@mroderick
mroderick deleted the style/have-no-css-matchers branch October 30, 2026 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant