Sha256: 6ab2b633fc1cf46b443557aa942ec3ec4e467ea5d6c7dcb4f369e6ea2b0a7267

Contents?: true

Size: 1.46 KB

Versions: 28

Compression:

Stored size: 1.46 KB

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module RSpec
      module Capybara
        # @!parse
        #   # Checks for boolean visibility in Capybara finders.
        #   #
        #   # Capybara lets you find elements that match a certain visibility
        #   # using the `:visible` option. `:visible` accepts both boolean and
        #   # symbols as values, however using booleans can have unwanted
        #   # effects. `visible: false` does not find just invisible elements,
        #   # but both visible and invisible elements. For expressiveness and
        #   # clarity, use one of the # symbol values, `:all`, `:hidden` or
        #   # `:visible`.
        #   # Read more in
        #   # https://www.rubydoc.info/gems/capybara/Capybara%2FNode%2FFinders:all[the documentation].
        #   #
        #   # @example
        #   #   # bad
        #   #   expect(page).to have_selector('.foo', visible: false)
        #   #   expect(page).to have_css('.foo', visible: true)
        #   #   expect(page).to have_link('my link', visible: false)
        #   #
        #   #   # good
        #   #   expect(page).to have_selector('.foo', visible: :visible)
        #   #   expect(page).to have_css('.foo', visible: :all)
        #   #   expect(page).to have_link('my link', visible: :hidden)
        #   #
        #   class VisibilityMatcher < ::RuboCop::Cop::Base; end
        VisibilityMatcher = ::RuboCop::Cop::Capybara::VisibilityMatcher
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 4 rubygems

Version Path
rubocop-rspec-2.31.0 lib/rubocop/cop/rspec/capybara/visibility_matcher.rb
rubocop-rspec-2.30.0 lib/rubocop/cop/rspec/capybara/visibility_matcher.rb
rubocop-rspec-2.29.2 lib/rubocop/cop/rspec/capybara/visibility_matcher.rb
rubocop-rspec-2.29.1 lib/rubocop/cop/rspec/capybara/visibility_matcher.rb
rubocop-rspec-2.29.0 lib/rubocop/cop/rspec/capybara/visibility_matcher.rb
rubocop-rspec-2.28.0 lib/rubocop/cop/rspec/capybara/visibility_matcher.rb
rubocop-rspec-2.27.1 lib/rubocop/cop/rspec/capybara/visibility_matcher.rb
rubocop-rspec-2.27.0 lib/rubocop/cop/rspec/capybara/visibility_matcher.rb
mlh-rubocop-config-1.0.3 vendor/bundle/ruby/3.2.0/gems/rubocop-rspec-2.26.1/lib/rubocop/cop/rspec/capybara/visibility_matcher.rb
rubocop-rspec-2.26.1 lib/rubocop/cop/rspec/capybara/visibility_matcher.rb
rubocop-rspec-2.26.0 lib/rubocop/cop/rspec/capybara/visibility_matcher.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rubocop-rspec-2.22.0/lib/rubocop/cop/rspec/capybara/visibility_matcher.rb
rubocop-rspec-2.25.0 lib/rubocop/cop/rspec/capybara/visibility_matcher.rb
rubocop-rspec-2.24.1 lib/rubocop/cop/rspec/capybara/visibility_matcher.rb
rubocop-rspec-2.24.0 lib/rubocop/cop/rspec/capybara/visibility_matcher.rb
rubocop-rspec-2.23.2 lib/rubocop/cop/rspec/capybara/visibility_matcher.rb
rubocop-rspec-2.23.1 lib/rubocop/cop/rspec/capybara/visibility_matcher.rb
rubocop-rspec-2.23.0 lib/rubocop/cop/rspec/capybara/visibility_matcher.rb
mlh-rubocop-config-1.0.2 vendor/bundle/ruby/3.2.0/gems/rubocop-rspec-2.22.0/lib/rubocop/cop/rspec/capybara/visibility_matcher.rb
fablicop-1.10.3 vendor/bundle/ruby/3.2.0/gems/rubocop-rspec-2.22.0/lib/rubocop/cop/rspec/capybara/visibility_matcher.rb