mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-09 14:58:05 -05:00
Monkeypatch webrat for Nokogiri compatibility
This is an attempt to address the Webrat / Nokogiri compatibility issue [discussed here]. It monkeypatches Webrat to explicitly add the old default arguments to the invocation of to_xpath. Move monkey patch to its own file under test/support/webrat. I really need to get rid of webrat. Closes #5475 [discussed here] https://github.com/sparklemotion/nokogiri/issues/2469
This commit is contained in:
committed by
Carlos Antonio da Silva
parent
ee8f0f8e83
commit
90f46bac37
1
Gemfile
1
Gemfile
@@ -14,7 +14,6 @@ gem "rails-controller-testing", github: "rails/rails-controller-testing"
|
||||
gem "responders", "~> 3.1"
|
||||
|
||||
group :test do
|
||||
gem "nokogiri", "< 1.13"
|
||||
gem "omniauth-facebook"
|
||||
gem "omniauth-openid"
|
||||
gem "rexml"
|
||||
|
||||
@@ -112,7 +112,7 @@ GEM
|
||||
marcel (1.0.2)
|
||||
method_source (1.0.0)
|
||||
mini_mime (1.1.2)
|
||||
mini_portile2 (2.6.1)
|
||||
mini_portile2 (2.8.1)
|
||||
minitest (5.17.0)
|
||||
mocha (1.16.1)
|
||||
multi_xml (0.6.0)
|
||||
@@ -126,8 +126,8 @@ GEM
|
||||
net-smtp (0.3.3)
|
||||
net-protocol
|
||||
nio4r (2.5.8)
|
||||
nokogiri (1.12.5)
|
||||
mini_portile2 (~> 2.6.1)
|
||||
nokogiri (1.14.2)
|
||||
mini_portile2 (~> 2.8.0)
|
||||
racc (~> 1.4)
|
||||
oauth2 (2.0.9)
|
||||
faraday (>= 0.17.3, < 3.0)
|
||||
@@ -223,7 +223,6 @@ PLATFORMS
|
||||
DEPENDENCIES
|
||||
devise!
|
||||
mocha (~> 1.1)
|
||||
nokogiri (< 1.13)
|
||||
omniauth
|
||||
omniauth-facebook
|
||||
omniauth-oauth2
|
||||
|
||||
@@ -14,7 +14,6 @@ gem "rails-controller-testing"
|
||||
gem "responders", "~> 2.1"
|
||||
|
||||
group :test do
|
||||
gem "nokogiri", "< 1.13"
|
||||
gem "omniauth-facebook"
|
||||
gem "omniauth-openid"
|
||||
gem "timecop"
|
||||
|
||||
@@ -12,7 +12,6 @@ gem "rails-controller-testing"
|
||||
gem "responders", "~> 2.1"
|
||||
|
||||
group :test do
|
||||
gem "nokogiri", "< 1.13"
|
||||
gem "omniauth-facebook"
|
||||
gem "omniauth-openid"
|
||||
gem "timecop"
|
||||
|
||||
@@ -12,7 +12,6 @@ gem "rails-controller-testing"
|
||||
gem "responders", "~> 2.1"
|
||||
|
||||
group :test do
|
||||
gem "nokogiri", "< 1.13"
|
||||
gem "omniauth-facebook"
|
||||
gem "omniauth-openid"
|
||||
gem "timecop"
|
||||
|
||||
@@ -12,7 +12,6 @@ gem "rails-controller-testing", github: "rails/rails-controller-testing"
|
||||
gem "responders", "~> 3.1"
|
||||
|
||||
group :test do
|
||||
gem "nokogiri", "< 1.13"
|
||||
gem "omniauth-facebook"
|
||||
gem "omniauth-openid"
|
||||
gem "rexml"
|
||||
|
||||
@@ -18,7 +18,6 @@ if RUBY_VERSION >= "3.1"
|
||||
end
|
||||
|
||||
group :test do
|
||||
gem "nokogiri", "< 1.13"
|
||||
gem "omniauth-facebook"
|
||||
gem "omniauth-openid"
|
||||
gem "rexml"
|
||||
|
||||
@@ -12,7 +12,6 @@ gem "rails-controller-testing", github: "rails/rails-controller-testing"
|
||||
gem "responders", "~> 3.1"
|
||||
|
||||
group :test do
|
||||
gem "nokogiri", "< 1.13"
|
||||
gem "omniauth-facebook"
|
||||
gem "omniauth-openid"
|
||||
gem "rexml"
|
||||
|
||||
12
test/support/webrat/matchers.rb
Normal file
12
test/support/webrat/matchers.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
# Monkey patch for Nokogiri changes - https://github.com/sparklemotion/nokogiri/issues/2469
|
||||
module Webrat
|
||||
module Matchers
|
||||
class HaveSelector
|
||||
def query
|
||||
Nokogiri::CSS.parse(@expected.to_s).map do |ast|
|
||||
ast.to_xpath("//", Nokogiri::CSS::XPathVisitor.new)
|
||||
end.first
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user