Rspec test should pass but fails

前端 未结 4 1344
独厮守ぢ
独厮守ぢ 2021-01-14 16:59

I have this test from michael hartl book:

require \'spec_helper\'
  describe \"Static pages\" do
    let(:base_title) { \"Ruby on Rails Tutorial Sample App\"         


        
4条回答
  •  孤独总比滥情好
    2021-01-14 17:06

    Using capubara 2.0 you should use

    page.should have_title("The title")
    

    But in aint work if you dont add

    
    

    To your application.html

    page.title # => "The title"
    page.has_title?("The title") # => true
    page.should have_title("The title")
    

提交回复
热议问题