Sha256: 26edd303d5d673e12e64d6c328cbcefec371272efb1746492577def72b61096c

Contents?: true

Size: 1.27 KB

Versions: 28

Compression:

Stored size: 1.27 KB

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module RSpec
      module Capybara
        # @!parse
        #   # Checks for there is a more specific matcher offered by Capybara.
        #   #
        #   # @example
        #   #
        #   #   # bad
        #   #   expect(page).to have_selector('button')
        #   #   expect(page).to have_no_selector('button.cls')
        #   #   expect(page).to have_css('button')
        #   #   expect(page).to have_no_css('a.cls', href: 'http://example.com')
        #   #   expect(page).to have_css('table.cls')
        #   #   expect(page).to have_css('select')
        #   #   expect(page).to have_css('input', exact_text: 'foo')
        #   #
        #   #   # good
        #   #   expect(page).to have_button
        #   #   expect(page).to have_no_button(class: 'cls')
        #   #   expect(page).to have_button
        #   #   expect(page).to have_no_link('foo', class: 'cls', href: 'http://example.com')
        #   #   expect(page).to have_table(class: 'cls')
        #   #   expect(page).to have_select
        #   #   expect(page).to have_field('foo')
        #   #
        #   class SpecificMatcher < ::RuboCop::Cop::Base; end
        SpecificMatcher = ::RuboCop::Cop::Capybara::SpecificMatcher
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 4 rubygems

Version Path
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rubocop-rspec-2.22.0/lib/rubocop/cop/rspec/capybara/specific_matcher.rb
fablicop-1.10.2 vendor/bundle/ruby/3.2.0/gems/rubocop-rspec-2.22.0/lib/rubocop/cop/rspec/capybara/specific_matcher.rb
rubocop-rspec-2.22.0 lib/rubocop/cop/rspec/capybara/specific_matcher.rb
rubocop-rspec-2.21.0 lib/rubocop/cop/rspec/capybara/specific_matcher.rb
rubocop-rspec-2.20.0 lib/rubocop/cop/rspec/capybara/specific_matcher.rb
rubocop-rspec-2.19.0 lib/rubocop/cop/rspec/capybara/specific_matcher.rb
rubocop-rspec-2.18.1 lib/rubocop/cop/rspec/capybara/specific_matcher.rb
rubocop-rspec-2.18.0 lib/rubocop/cop/rspec/capybara/specific_matcher.rb