lib/rspec_html/search.rb in rspec-html-0.3.1 vs lib/rspec_html/search.rb in rspec-html-0.3.2
- old
+ new
@@ -148,10 +148,10 @@
end
def where_xpath(tag, query)
conditions = "[#{where_conditions(query)}]" unless query.compact.empty?
result = @element&.xpath(".//#{tag}#{conditions}")
- return result unless @siblings.is_a?(Nokogiri::XML::NodeSet) && result.empty?
+ return result unless @siblings.is_a?(Nokogiri::XML::NodeSet) && (result.nil? || result.empty?)
@siblings.xpath(".//#{tag}#{conditions}")
end
def where_conditions(query)