RSpec::HTML provides a simple object interface to HTML content.
You can use RSpec::HTML to test any HTML produced by your library or application and it works out of the box with RSpec Rails request specs.
Load rspec-html
in your spec_helper.rb
:
# spec/spec_helper.rb
require 'rspec/html'