On previous RSpec integration tests where :js => false (i.e., JavaScript was turned off), my tests were running just fine. However, for RSpec tests where :js => true (and therefore needing to use capybara WebKit), I consistently get the following error:
Unable to load URL: http://my.server:5000/auth/identity because of error loading http://my.server:5000/auth/identity: Unknown error
Noted this is happening on a line of code that was working just fine when :js => false (it is part of a method that signs in a user, which is required for both sets of integration tests).
What I have tried:
- Using ufw (since I am running on Ubuntu), I made sure that port 5000 is open. However, I don't think that this was the problem anyway, since the tests were able to run fine using the same port in other tests when :js => false
- Visiting other pages (e.g., http://my.server:5000/), but the same error message appears.
I tried using the debugging code that capybara WebKit documentation provides:
Capybara::Webkit.configure do |config| config.debug = true
I put it in my spec_helper.rb. But this ends up giving me another error message, namely: NoMethodError: undefined method configure' for Capybara::Webkit:Module
.
- I tried stopping and restarting spring (using
spring stop
andspring restart
) following these instructions. Still nothing is working. (I tried running the tests after both commands, and still got the same error message both times)
Notes on my configuration:
When I received the project, the spec_helper.rb file had
Capybara.server_port = 5000
, and I haven't changed that. This variable is then used in all of thevisit
methods (e.g., `visit "http://my.server:#{Capybara.server_port}/").There is no line that has
Capybara.app_host = ______
This web app includes three subdomains which I will need to be able to access:
cms.my.server
,www.my.server
, andadmin.my.server
. (Keep in mind thatmy.server
is a stand-in for the actual server name, which I cannot use for legal reasons). All 3 of these are set to resolve to 127.0.0.1 in my hosts file.
Also note that my teammate has got the exact same test to work.