0
所以我想最好的办法是去测试什么,一个网页使用水豚最佳实践
describe "Pages" do
subject { page }
describe "Home page" do
it "should have the title 'My Home Page'" do
visit root_path
expect(page).to have_title('My Home Page')
end
end
end
现在看起来像标准的方式来测试这是实际访问比较页面的标题(如上)。尽管这看起来不是很健壮,就好像页面标题改变一样,它会打破任何引用它的测试。
这是标准做法吗?还是有另一种方法来测试它。
谢谢, 马特