Capybara::ElementNotFound: Unable to find xpath "/html"

Habe ich nach dem Ruby on Rails-tutorial auf http://ruby.railstutorial.org/chapters/static-pages und kam in den folgenden Fehlers

 StaticPages Home page should have the content 'Sample App'
 Failure/Error: page.should have_content('Sample App')
 Capybara::ElementNotFound:
   Unable to find xpath "/html"
 # (eval):2:in `text'
 # ./spec/requests/static_pages_spec.rb:7:in `(root)'

Mein Juwel-Datei ist wie folgt

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

Wie bekomme ich diesen Fehler loszuwerden, und übergeben Sie die rspec?
Die Quell-Datei

require 'spec_helper'

describe "StaticPages" do

  describe "Home page" do

    it "should have the content 'Sample App'" do
      visit '/static_pages/home'
      # puts page.html
      page.should have_content('Sample App')
    end
  end
end
Möglich, Duplikat der stackoverflow.com/questions/11382415/... überprüfen Sie Bitte, ob diese Skillung ist in spec/controllers oder Spezifikation/Anforderungen

InformationsquelleAutor absessive | 2012-05-15

Schreibe einen Kommentar