lib/rubocop/cop/rspec/capybara/current_path_expectation.rb in rubocop-rspec-2.12.1 vs lib/rubocop/cop/rspec/capybara/current_path_expectation.rb in rubocop-rspec-2.13.0
- old
+ new
@@ -12,17 +12,23 @@
# 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')
- # expect(page.current_path).to match(/widgets/)
#
# # good
- # expect(page).to have_current_path("/callback")
- # expect(page).to have_current_path(/widgets/)
+ # 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 < Base
extend AutoCorrector
MSG = 'Do not set an RSpec expectation on `current_path` in ' \