with headers {'Accept'=>'*/*', 'User-Agent'=>'Ruby'} (WebMock::NetConnectNotAllowedError) You can stub this request with the following snippet: stub_request(:get, "https://api.github.com/users/rodrigoflores/repos"). with(:headers => {'Accept'=>'*/*', 'User-Agent'=>'Ruby'}). to_return(:status => 200, :body => "", :headers => {}) registered request stubs: stub_request(:get, "https://api.github.com/users/josevalim/repos") Não “stuba” o Net::HTTP Monday, May 27, 13