Sha256: 6db08b40f7e008fc0b0831d3690c673e034e5a62de6281554b8b79565bc11ed9

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 that no expectations are set on Capybara's `current_path`.
        #   #
        #   # The
        #   # https://www.rubydoc.info/github/teamcapybara/capybara/master/Capybara/RSpecMatchers#have_current_path-instance_method[`have_current_path` matcher]
        #   # should be used on `page` to set expectations on Capybara's
        #   # current path, since it uses
        #   # https://github.com/teamcapybara/capybara/blob/master/README.md#asynchronous-javascript-ajax-and-friends[Capybara's waiting functionality]
        #   # which ensures that preceding actions (like `click_link`) have
        #   # completed.
        #   #
        #   # This cop does not support autocorrection in some cases.
        #   #
        #   # @example
        #   #   # bad
        #   #   expect(current_path).to eq('/callback')
        #   #
        #   #   # good
        #   #   expect(page).to have_current_path('/callback')
        #   #
        #   #   # bad (does not support autocorrection)
        #   #   expect(page.current_path).to match(variable)
        #   #
        #   #   # good
        #   #   expect(page).to have_current_path('/callback')
        #   #
        #   class CurrentPathExpectation < ::RuboCop::Cop::Base; end
        CurrentPathExpectation =
          ::RuboCop::Cop::Capybara::CurrentPathExpectation
      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/current_path_expectation.rb
fablicop-1.10.2 vendor/bundle/ruby/3.2.0/gems/rubocop-rspec-2.22.0/lib/rubocop/cop/rspec/capybara/current_path_expectation.rb
rubocop-rspec-2.22.0 lib/rubocop/cop/rspec/capybara/current_path_expectation.rb
rubocop-rspec-2.21.0 lib/rubocop/cop/rspec/capybara/current_path_expectation.rb
rubocop-rspec-2.20.0 lib/rubocop/cop/rspec/capybara/current_path_expectation.rb
rubocop-rspec-2.19.0 lib/rubocop/cop/rspec/capybara/current_path_expectation.rb
rubocop-rspec-2.18.1 lib/rubocop/cop/rspec/capybara/current_path_expectation.rb
rubocop-rspec-2.18.0 lib/rubocop/cop/rspec/capybara/current_path_expectation.rb