I'm trying to block URLs in my specs, achieving something like I had when using capybara_webkit
:
Capybara::Webkit.configure do |config|
config.block_url("*google*")
config.allow_url('*my_website.com')
end
After reading this article, I tried to do something like:
require 'webmock/rspec'
module WebmockConfig
def self.default_disabled_urls
[
'*google*'
]
end
end
WebMock.disable_net_connect!(allow_localhost: true)
WebMock.disable_net_connect!(allow: WebmockConfig.default_disabled_urls)
but I'm getting
Real HTTP connections are disabled. Unregistered request: POST http://127.0.0.1/session
even if that should be solved by WebMock.disable_net_connect!(allow_localhost: true)
.
When running the specs without WebMock.disable_net_connect!(allow: WebmockConfig.default_disabled_urls)
, everything is working fine.
headless_chrome
) withpuffing-billy
fucntionalities? – Vaporetto