From 60f117c4af3d88744536206b7233a90baaba4653 Mon Sep 17 00:00:00 2001 From: Thomas Walpole Date: Wed, 9 Jun 2021 22:54:45 -0700 Subject: [PATCH] Fix parameter name type --- lib/capybara/rspec/matchers/have_selector.rb | 2 +- lib/capybara/spec/session/has_any_selectors_spec.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/capybara/rspec/matchers/have_selector.rb b/lib/capybara/rspec/matchers/have_selector.rb index 719be77d..075847e8 100644 --- a/lib/capybara/rspec/matchers/have_selector.rb +++ b/lib/capybara/rspec/matchers/have_selector.rb @@ -64,7 +64,7 @@ module Capybara el.assert_any_of_selectors(*@args, **session_query_options, &@filter_block) end - def does_not_match?(_actual) + def does_not_match?(el) el.assert_none_of_selectors(*@args, **session_query_options, &@filter_block) end diff --git a/lib/capybara/spec/session/has_any_selectors_spec.rb b/lib/capybara/spec/session/has_any_selectors_spec.rb index 3cbd3e86..54bd3c94 100644 --- a/lib/capybara/spec/session/has_any_selectors_spec.rb +++ b/lib/capybara/spec/session/has_any_selectors_spec.rb @@ -22,4 +22,8 @@ Capybara::SpecHelper.spec '#have_any_of_selectors' do expect(@session).to have_any_of_selectors('p a#blah', 'h2#h2three') end.to raise_error ::RSpec::Expectations::ExpectationNotMetError end + + it 'should be negateable' do + expect(@session).not_to have_any_of_selectors(:css, 'span a#foo', 'h2#h2nope', 'h2#h2one_no') + end end