Capybara: How to test the title of a page?

前端 未结 8 1631
一向
一向 2020-12-08 12:41

In a Rails 3 application using Steak, Capybara and RSpec how do I test the page\'s title?

8条回答
  •  旧巷少年郎
    2020-12-08 13:28

    This works under Rails 3.1.10, Capybara 2.0.2 and Rspec 2.12, and allows matching partial contents:

    find('title').native.text.should have_content("Status of your account::")
    

提交回复
热议问题