You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my Rails project I have a utility class (plain old ruby object) which does a request to GitHub api and saves Project model. Just a moment ago I have started using ElasticSearch and my Project model has some stuff indexed. Each time I save this model a request to ElasticSearch is made on port 9200. Majority of my tests started to fail (because of the extra requests) with a message:
FakeWeb::NetConnectNotAllowedError:
Real HTTP connections are disabled. Unregistered request: PUT http://localhost:9200/karma_tracker_test/project/236
explicitly in a test, or in a before(:each) block in spec_helper the test still fails. But if I put the same line in my utility class just before save, the test passes
In my
Rails
project I have a utility class (plain old ruby object) which does a request to GitHub api and saves Project model. Just a moment ago I have started using ElasticSearch and my Project model has some stuff indexed. Each time I save this model a request to ElasticSearch is made on port9200
. Majority of my tests started to fail (because of the extra requests) with a message:Now when I do
explicitly in a test, or in a before(:each) block in spec_helper the test still fails. But if I put the same line in my utility class just before save, the test passes
Whole code is online at https://github.com/amberbit/KarmaTracker/tree/feature/59079242_elastic_search - failing test spec/model/pivotal_tracker_projects_fetcher_spec.rb:16, failing class app/services/pivotal_tracker_projects_fetcher.rb line 18
Adding a test-related logic inside app logic feels really bad. Any way to make it more clean or is it a bug?
The text was updated successfully, but these errors were encountered: