Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Specs not running with elasticsearch #163
I'm using webmock 1.7.10 and elasticsearch+tire(https://github.com/karmi/tire). When running the specs it tries to access localhost:9200 on start and webmock halts the process because this request is not stubbed. I tried
also didn't work.
Is there any solution or workaround? This is not specific to some particular specs, this prevents me from being able to run specs at all, so it's a major issue for me, please advice.
Here are just the bare bones:
Everything else is standard Rails stuff. When running
There's a similar issue on
at the very top of
Yes, that's a correct way.
I.e it's very common to disable_net_connect with exception to localhost when webmock is used with selenium webdriver.
If you want to be more specific, and allow only one connection, you could do WebMock.disable_net_connect!(:allow => "localhost:9200") instead.
Just for the record:
require 'webmock' WebMock.allow_net_connect!
to very top of
Use a initializers:
# File: config/initializers/webmock.rb if Rails.env.test? require 'webmock' WebMock.disable_net_connect!(allow_localhost: true) end
Thank you for your work on the gem.
I've been getting sporadic corruption and failures in my rspec test suite. Similar to the discussion in this thread, I have
I have a test file1 (for testing fake requests) that
I realized that if file2 runs first, then its real requests would fail. I believe this is because rspec loads all the test files and its require statements, which in my case a
The suggestion to add the following to the top of spec_helper.rb:
kind of work, but breaks my spork (yes, it's kinda old technology) with cryptic errors. My question: Is there another way?