Skip to content

Instantly share code, notes, and snippets.

@tibbon
Created November 29, 2012 22:23
Show Gist options
  • Save tibbon/4172305 to your computer and use it in GitHub Desktop.
Save tibbon/4172305 to your computer and use it in GitHub Desktop.
Twitter Test Failure results
Failures:
1) Twitter::API::FriendsAndFollowers#friends with a screen_name passed requests the correct resource
Failure/Error: @client.friends("sferik")
WebMock::NetConnectNotAllowedError:
Real HTTP connections are disabled. Unregistered request: GET https://api.twitter.com/1.1/friends/list.json?screen_name=sferik with headers {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization'=>'OAuth oauth_nonce="3d48576db86a5390bdc1deaec65c4a13", oauth_signature="h5gsi6Xj8li8Jqn7VzivG399rQc%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1354227722", oauth_version="1.0"', 'User-Agent'=>'Twitter Ruby Gem 4.3.0'}
You can stub this request with the following snippet:
stub_request(:get, "https://api.twitter.com/1.1/friends/list.json?screen_name=sferik").
with(:headers => {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization'=>'OAuth oauth_nonce="3d48576db86a5390bdc1deaec65c4a13", oauth_signature="h5gsi6Xj8li8Jqn7VzivG399rQc%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1354227722", oauth_version="1.0"', 'User-Agent'=>'Twitter Ruby Gem 4.3.0'}).
to_return(:status => 200, :body => "", :headers => {})
registered request stubs:
stub_request(:get, "https://api.twitter.com/1.1/friends/list.json?cursor=-1&screen_name=sferik")
============================================================
# ./lib/twitter/request/multipart_with_file.rb:19:in `call'
# ./lib/twitter/client.rb:81:in `request'
# ./lib/twitter/client.rb:64:in `get'
# ./lib/twitter/api/utils.rb:30:in `collection_from_response'
# ./lib/twitter/api/utils.rb:52:in `objects_from_response'
# ./lib/twitter/api/friends_and_followers.rb:310:in `friends'
# ./spec/twitter/api/friends_and_followers_spec.rb:472:in `block (4 levels) in <top (required)>'
Finished in 1.94 seconds
201 examples, 1 failure
Failed examples:
rspec ./spec/twitter/api/friends_and_followers_spec.rb:471 # Twitter::API::FriendsAndFollowers#friends with a screen_name passed requests the correct resource
Randomized with seed 326
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment