From 8826156be98565c6d32e8184341c625cf6273f66 Mon Sep 17 00:00:00 2001 From: Thomas Walpole Date: Wed, 17 Aug 2016 18:43:27 -0700 Subject: [PATCH] update and test for css query special character escaping --- capybara.gemspec | 7 +++---- lib/capybara/spec/session/find_spec.rb | 5 +++++ lib/capybara/spec/views/with_html.erb | 4 +++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/capybara.gemspec b/capybara.gemspec index a0ced6f2..6ba01af8 100644 --- a/capybara.gemspec +++ b/capybara.gemspec @@ -18,10 +18,9 @@ Gem::Specification.new do |s| s.homepage = "https://github.com/teamcapybara/capybara" s.require_paths = ["lib"] - s.rubygems_version = "1.3.6" s.summary = "Capybara aims to simplify the process of integration testing Rack applications, such as Rails, Sinatra or Merb" - s.add_runtime_dependency("nokogiri", [">= 1.6.7"]) + s.add_runtime_dependency("nokogiri", [">= 1.6.8"]) s.add_runtime_dependency("mime-types", [">= 2.0"]) s.add_runtime_dependency("rack", [">= 1.6.0"]) s.add_runtime_dependency("rack-test", [">= 0.6.3"]) @@ -32,8 +31,8 @@ Gem::Specification.new do |s| s.add_development_dependency("sinatra", [">= 1.4.0"]) s.add_development_dependency("rspec", [">= 3.4.0"]) s.add_development_dependency("launchy", [">= 2.0.4"]) - s.add_development_dependency("yard", [">= 0.5.8"]) - s.add_development_dependency("fuubar", [">= 0.0.1"]) + s.add_development_dependency("yard", [">= 0.9.0"]) + s.add_development_dependency("fuubar", [">= 1.0.0"]) s.add_development_dependency("cucumber", [">= 2.3.0"]) s.add_development_dependency("rake") s.add_development_dependency("puma") diff --git a/lib/capybara/spec/session/find_spec.rb b/lib/capybara/spec/session/find_spec.rb index 06af2e72..f188db22 100644 --- a/lib/capybara/spec/session/find_spec.rb +++ b/lib/capybara/spec/session/find_spec.rb @@ -85,6 +85,11 @@ Capybara::SpecHelper.spec '#find' do it "should support pseudo selectors" do expect(@session.find(:css, 'input:disabled').value).to eq('This is disabled') end + + it "should support escaping characters" do + expect(@session.find(:css, '#\31 escape\.me').text).to eq('needs escaping') + expect(@session.find(:css, '.\32 escape').text).to eq('needs escaping') + end end context "with xpath selectors" do diff --git a/lib/capybara/spec/views/with_html.erb b/lib/capybara/spec/views/with_html.erb index 94d0256e..91c51998 100644 --- a/lib/capybara/spec/views/with_html.erb +++ b/lib/capybara/spec/views/with_html.erb @@ -150,4 +150,6 @@ banana
Pre Sibling
Post Sibling
- \ No newline at end of file + + +
needs escaping