rspec入门

1 describe "Home page" do
2 
3   it "should have the content 'Sample App'" do
4     visit '/static_pages/home'  #使用了Capybara中的visit函数来模拟在浏览器中访问/static_pages/home的操作
5     expect(page).to have_content('Sample App') #使用了Capybara中的page变量来测试页面中是否包含了正确的内容
6   end
7 end

 

posted on 2014-03-17 00:27  秋叶leaf  阅读(155)  评论(0编辑  收藏  举报