2015-07-04 74 views
3

我不能正確理解放置此方法調用的位置。我有這個test_helper.rb文件NameError:未初始化的常量Capybara :: Webkit.configure

ENV['RAILS_ENV'] ||= 'test' 
require File.expand_path('../../config/environment', __FILE__) 

require 'rails/test_help' 
require 'minitest/rails/capybara' 
require 'capybara' 
require 'capybara/rails' 
require 'capybara/webkit' 

Dir[Rails.root.join('test/support/**/*.rb')].each { |f| require f } 

Capybara::Webkit.configure do |config| 
    config.allow_unknown_urls 
end 

而且我得到這個錯誤,當我運行rake test

NoMethodError:未定義的方法configure' for Capybara::Webkit:Module /Users/sameer/code/rails/door_app/test/test_helper.rb:XX:in'

好像我在做什麼自述在水豚描述-webkit Github頁面。

回答

5

這可能是spring gem版本與rspec版本兼容的問題。我更新了寶石並且解決了。

+0

我需要一個'捆綁update' – juliangonzalez

2

我遇到了同樣的問題,通過將capybara-webkit從1.5.2升級到1.6.0來解決。

0

我有同樣的問題,通過重新啓動彈簧服務器spring stop修復。二手水豚,WebKit的1.11.1

0

你需要安裝一個寶石

group :test do 
    ... 
    gem 'capybara-webkit' 

end 
相關問題