Repository navigation
style: replace have_no_selector with have_no_css in stats specs - #3065
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-clears the RuboCop failure on #3063 so that PR can stay dependency-only.
Problem
rubocop-capybara3.1.0 (part of the ruby-deps group bump in #3063) teachesCapybara/RSpec/HaveSelectorto detecthave_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_selectorwithhave_no_cssat the six flagged lines inspec/features/admin/stats_page_spec.rbandspec/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
thwithtext:,td[colspan]).Gemfile/Gemfile.lockchanges here. This lands independently of chore(deps): bump the ruby-deps group across 1 directory with 7 updates #3063, which then only needs a rebase or rerun after this merges.