我正在从这个网站学习。我用rspec测试了以下内容,它通过了。
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
我改为About Us检查<h1>About Us</h1>它是否按预期工作,但即使about.html.erb有 string ,测试也会失败<h1>About Us</h1>。你能告诉我如何在 rspec 文件中使用 html 标记表达式吗?