ruby on rails - Capybara: How to test the title of a page? -


in rails 3 application using steak, capybara , rspec how test page's title?

since version 2.1.0 of capybara there methods on session deal title. have

page.title page.has_title? "my title" page.has_no_title? "my not found title" 

so can test title like:

expect(page).to have_title "my_title" 

according github.com/jnicklas/capybara/issues/863 following working capybara 2.0:

expect(first('title').native.text).to eq "my title" 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -