I follow the Ruby on Rails tutorial at http://ruby.railstutorial.org/chapters/static-pages and stumbled upon the following error
StaticPages Home page should have the content 'Sample App'
Failure/Error: page.should have_content('Sample App')
Capybara::ElementNotFound:
Unable to find xpath "/html"
My gem file is as follows
source 'http://rubygems.org'
gem 'rails', '3.0.10'
gem 'jruby-openssl'
gem 'activerecord-jdbcsqlite3-adapter'
group :development, :test do
gem 'webrat'
gem 'rspec-rails', ">= 2.10.0"
gem 'capybara', ">= 1.1.2"
end
How do I get rid of this error and pass rspec? Original file
require 'spec_helper'
describe "StaticPages" do
describe "Home page" do
it "should have the content 'Sample App'" do
visit '/static_pages/home'
page.should have_content('Sample App')
end
end
end
source
share