kucaahbe / rspec-html-matchers

Old school have_tag, with_tag(and more) matchers for rspec 3 (Nokogiri powered)
http://rubygems.org/gems/rspec-html-matchers
MIT License
199 stars 90 forks source link

Nested "with_tag"s #24

Closed manuelmeurer closed 7 years ago

manuelmeurer commented 11 years ago

As far as I can see, this doesn't work yet:

html.should have_tag(:div, with: { class: 'navbar' }) do
  with_tag :div, with: { class: 'navbar-inner' } do
    with_tag :div, with: { class: 'container' }
  end
end

Or rather, it works, but it passes regardless of whether the container div is really nested in the navbar-inner div, it could be on the same level or even nested the other way around.

Is that something that is supposed to work right now? Looking at the code, it might just be about setting @__current_scope_for_nokogiri_matcher correctly when calling with_tag, right?

kucaahbe commented 11 years ago

yes, current implementation has these limitations, but I'm working on some internal re-factoring which will fix this and #22 issues, and, I hope will be more understandable by other people.

manuelmeurer commented 11 years ago

Okay great, let me know if I can help with anything.

ericgriffis commented 8 years ago

@kucaahbe I know this is old, but I encountered the same issue. Has any progress been made on this issue? I would be happy to help out

randoum commented 7 years ago

@ericgriffis if you are still on this, would you mind to check #59 and see if your issues are fixed ?

randoum commented 7 years ago

@ericgriffis please have a try with 0.9.0 see if your issue is solved Otherwise, feel free to reopen with more details