Switch Faraday adapter to typhoeus

It uses curl which has less problems connecting
to a missconfigured IPv6 host (falls back to v4)
This commit is contained in:
Jonne Haß 2014-09-06 23:15:44 +02:00
parent c225bb17ce
commit 9c88fde821
2 changed files with 8 additions and 1 deletions

View file

@ -1,6 +1,13 @@
# Copyright (c) 2010-2011, Diaspora Inc. This file is # Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See # licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file. # the COPYRIGHT file.
# Use net_http in test, that's better supported by webmock
unless Rails.env.test?
require 'typhoeus/adapters/faraday'
Faraday.default_adapter = :typhoeus
end
options = { options = {
request: { request: {
timeout: 25 timeout: 25

View file

@ -19,7 +19,7 @@ describe Diaspora::Fetcher::Public do
stub_request(:get, /remote-testpod.net\/people\/.*/) stub_request(:get, /remote-testpod.net\/people\/.*/)
.with(headers: { .with(headers: {
'Accept'=>'application/json', 'Accept'=>'application/json',
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
'User-Agent'=>'diaspora-fetcher' 'User-Agent'=>'diaspora-fetcher'
}).to_return(:body => @fixture) }).to_return(:body => @fixture)