How to check html tag with Rspec
- by Tetsu
I'm learning from this site. I tested the following with rspec, and it passed.
describe "About page" do
it "should have the content 'About Us'" do
visit '/static_pages/about'
expect(page).to have_content('About Us')
end
end
I changed About Us to <h1>About Us</h1> to check whether it works as I expected, but the test fails even when about.html.erb has the string <h1>About Us</h1>. Could you show me how I can use html tag expression in rspec file?