Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removing attribute doesn't affect results of xpath query when using JRuby #1109

Closed
twalpole opened this issue May 19, 2014 · 1 comment
Closed

Comments

@twalpole
Copy link
Contributor

Removing an attribute from an element appears to not clear a cache somewhere when using JRuby - behaves correctly when using MRI. Currently causing capybara to fail when used with JRuby and nokogiri 1.6.2.1

doc = Nokogiri::HTML("<html><div selected></div></html>")
elements = doc.xpath('//div[@selected]') 
puts elements.size()   # 1
elements[0].remove_attribute('selected')
puts doc.xpath('//div[@selected]').size()  # 0 with MRI - 1 with JRuby
@flavorjones
Copy link
Member

Thanks so much for reporting this! I've confirmed this issue is present on master and 1.6.2.1.

I've created a branch named "issue-1109-jruby-xpath-cache" with the above code committed as a failing test.

@jvshahid or @yokolet -- either of you want to take a look at addressing this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants