lib/capybara/spec/session/has_selector_spec.rb in capybara-2.6.2 vs lib/capybara/spec/session/has_selector_spec.rb in capybara-2.7.0
- old
+ new
@@ -1,5 +1,6 @@
+# frozen_string_literal: true
Capybara::SpecHelper.spec '#has_selector?' do
before do
@session.visit('/with_html')
end
@@ -63,9 +64,14 @@
end
it "should discard all matches where the given regexp is not matched" do
expect(@session).to have_selector("//p//a", :text => /re[dab]i/i, :count => 1)
expect(@session).not_to have_selector("//p//a", :text => /Red$/)
+ end
+
+ it "should warn when extra parameters passed" do
+ expect_any_instance_of(Kernel).to receive(:warn).with(/extra/)
+ expect(@session).to have_selector(:css, "p a#foo", 'extra')
end
end
end
Capybara::SpecHelper.spec '#has_no_selector?' do