因此,尝试使用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]
答案 0 :(得分:1)
确保它位于test_helper.rb
中require "capybara/rails"