title: Stuck with Faraday in rspec
body: <p>I'm trying to write a test calling an API using Faraday with RSpec. The calling is in the .execute method and it works normally in production, but in test, I'm stuck with this error: </p>
  
  <pre><code>Failure/Error: @response ||= conn.post '/oauth/token', @params
  
       Faraday::ConnectionFailed:
         Failed to open TCP connection to :80 (Connection refused - connect(2) for nil port 80)
  </code></pre>
  
  <p>And the test is like this</p>
  
  <pre><code>it 'access_token should not be nil' do
        @auth = AuthenticateService.new(params)
        auth_exec = @auth.execute
        access_token = auth_exec[:access_token]
        expect(access_token.present?).not_to be_empty
      end
  </code></pre>
  
  <p>Do I need to configure something to make Faraday works with test?</p>