Estoy usando capibara en lugar de webrat en rieles. He instalado el capibara y uso gem 'capybara' en Gemfile. cuando usocss esperado "título" con texto en capybara
page.should have_selector("title", :text => "anything title")
es dar un error
Failure/Error: page.should have_selector("title", :text => "anything title")
expected css "title" with text "anything title" to return something
archivo de prueba es la siguiente:
require 'spec_helper'
describe "Test pages" do
describe "Home page" do
it "should have the content 'Demo App'" do
visit '/test_pages/home'
page.should have_selector("title", :text => "anything title")
end
end
end
¿Has probado 'save_and_open_page' justo antes de tu afirmación de prueba para ver lo que Capybara cree que está viendo? – nmott