From f176db6e7da957280d56768836944fca5e09cb31 Mon Sep 17 00:00:00 2001 From: Aga Dufrat Date: Tue, 18 Jun 2024 12:39:35 +0100 Subject: [PATCH] Update RSpec/Dialect config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit so that all Capybara-specific methods that have the same native RSpec method (e.g. are just aliases) following the upgrade to rubocop-rspec 3.0. See: - https://github.com/rubocop/rubocop-rspec/pull/1848/files - https://github.com/rubocop/rubocop-rspec/commit/1fa9ce3a5a02a0727179b387596a4f4a036ba765 > If you were previously using the ‘RSpec/Capybara/FeatureMethods` cop and want to keep disabling all Capybara-specific methods that have the same native RSpec method (e.g. are just aliases), use the following config: > > ``` > RSpec/Dialect: > PreferredMethods: > background: :before > scenario: :it > xscenario: :xit > given: :let > given!: :let! > feature: :describe > ``` --- config/rspec.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/config/rspec.yml b/config/rspec.yml index c0946be..ca7db34 100644 --- a/config/rspec.yml +++ b/config/rspec.yml @@ -56,6 +56,15 @@ RSpec/ContextWording: # scenario. # We don't want this cop outside of feature or system specs though. RSpec/Dialect: + # Disables all Capybara-specific methods that have the same native + # RSpec method (e.g. are just aliases) + PreferredMethods: + background: :before + scenario: :it + xscenario: :xit + given: :let + given!: :let! + feature: :describe Exclude: - 'spec/features/**/*.rb' - 'spec/system/**/*.rb'