ruby on rails - have_selector testing page title does not work -
i have following codes testing
require 'spec_helper' describe pagescontroller render_views describe "get 'home'" "returns http success" 'home' response.should be_success end "should have right title" 'home' response.should have_selector("title", :content => "ruby on rails tutorial sample app | home") end end
but when run rspec spec/ have error validating page title. have modified home.html.erb this
<!doctype html> <html> <head> <title>ruby on rails tutorial sample app | home</title> </head> <body> <h1>sample app home page</h1> <p>find me in app/views/pages/home.html.erb</p> </body> </html>
i have rspec version 2.13.0 capybara version 2.1.0
try:
response.should have_content "ruby on rails tutorial sample app | home"
Comments
Post a Comment