Capybara :: Webkit :: InvalidResponseError:无法加载URL:file:///

时间:2014-05-15 03:28:11

标签: ruby-on-rails ruby-on-rails-4 capybara capybara-webkit

因此,尝试使用Capybara在TestUnit中运行集成测试时出现此错误。

它正在尝试将文件加载到file:///

有什么想法吗?

# Running:

E

Finished in 1.072113s, 0.9327 runs/s, 0.0000 assertions/s.

  1) Error:
SignInTest#test_user_signs_in_successfully:
Capybara::Webkit::InvalidResponseError: Unable to load URL: file:/// because of error loading file:///: Unknown error
    test/integration/sign_in_test.rb:12:in `block in <class:SignInTest>'

1 runs, 0 assertions, 0 failures, 1 errors, 0 skips
[Finished in 6.2s with exit code 1]
[cmd: ["/usr/local/bin/rbenv exec ruby -Itest test/integration/sign_in_test.rb -n 'test_user_signs_in_successfully'"]]
[dir: /Users/user/code/project]
[path: /usr/bin:/bin:/usr/sbin:/sbin]

1 个答案:

答案 0 :(得分:1)

确保它位于test_helper.rb

require "capybara/rails"