I guess should also be possible to write something like this:
```ruby
expect(Nokogiri::HTML(processed_html)).to have_xpath('//h2', count: 1)
```
But not sure about it.