Skip to content

Instantly share code, notes, and snippets.

Avatar

mikesutton

  • Spain
View GitHub Profile
@mikesutton
mikesutton / gist:6150863
Created Aug 4, 2013
requiring json in the cucumber script fixes it.
View gist:6150863
#!/usr/bin/env ruby
vendored_cucumber_bin = Dir["#{File.dirname(__FILE__)}/../vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
if vendored_cucumber_bin
load File.expand_path(vendored_cucumber_bin)
else
require 'rubygems' unless ENV['NO_RUBYGEMS']
require 'json'
require 'cucumber'
load Cucumber::BINARY
View webmock_curious_case
the error:
Failure/Error: client = twitterController.sign_in_as_tagoid
WebMock::NetConnectNotAllowedError:
Real HTTP connections are disabled. Unregistered request: GET https://api.twitter.com/1/account/verify_credentials.json with headers {'Accept'=>'application/json', 'Authorization'=>'OAuth oauth_consumer_key="P0O33Z4p4o0XltMlcPZ3A", oauth_nonce="962c77e088b7427895f0628fea5990f7", oauth_signature="1k%2BFVLF%2BqFlogPwNgtwD7xctJA0%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1296828033", oauth_token="14980953-MbJv9wiK8fjZtvYClI7Kyt778R0JurPIxuIOyiQFV", oauth_version="1.0"', 'User-Agent'=>'Twitter Ruby Gem 1.1.1'}
You can stub this request with the following snippet:
stub_request(:get, "https://api.twitter.com/1/account/verify_credentials.json").
You can’t perform that action at this time.