Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Whitelisting Specs won't pass offline #738

Closed
nritholtz opened this issue Mar 19, 2015 · 2 comments
Closed

Whitelisting Specs won't pass offline #738

nritholtz opened this issue Mar 19, 2015 · 2 comments

Comments

@nritholtz
Copy link
Contributor

I usually do most of my work offline, on my laptop on a train. I noticed that the whitelisting specs would always fail unless I was connected to the internet.

An example of the failure is:

1) Capybara::Webkit::Driver url whitelisting behaves like output writer prints a warning for remote requests by default
     Failure/Error: driver.visit("#{AppRunner.app_host}#{url}")
     Capybara::Webkit::InvalidResponseError:
       Unable to load URL: http://127.0.0.1:61432/ because of error loading http://example.com/path: Unknown error
     Shared Example Group: "output writer" called from ./spec/driver_spec.rb:2655

This would mostly likely have to with the iframe src pointing to http sites, for example at https://github.com/thoughtbot/capybara-webkit/blob/master/spec/driver_spec.rb#L2661

Is there some way to make this work offline as well?

@mhoran
Copy link
Collaborator

mhoran commented Mar 19, 2015

Given that's sort of the point of this spec, I'm not sure there's an easy way to solve this. An alternative would be to set up entries in e.g. /etc/hosts, which would have to be maintained on the local system. The nice thing about DNS (and the example.com domain) is that it requires no local configuration.

We could possibly add a flag to the specs which require Internet connectivity and disable them (or allow them to be disabled) for offline testing. We should probably remove dependencies on DNS for any specs which do not require it. However, the whitelist/blacklist specs are specifically testing this functionality.

@nritholtz
Copy link
Contributor Author

Thanks. I figured as much looking at the tests myself.

If it's OK, I'd like to leave this open for future implementation of the offline flag for the specs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants