Skip to content

Instantly share code, notes, and snippets.

@morhekil
Last active January 21, 2016 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save morhekil/a61937fb8011791b6b0c to your computer and use it in GitHub Desktop.
Save morhekil/a61937fb8011791b6b0c to your computer and use it in GitHub Desktop.
def stubs(f)
f.post '/v1/oauth2/token?grant_type=client_credentials' do |env|
expect(apicalls.shift).to eq env.url.path
respond_to_auth_call env
end
f.post '/v1/transferOut' do |env|
expect(apicalls.shift).to eq env.url.path
validate_transfer_out_call env
respond_to_transfer_out_call env
end
end
before do
Faraday.default_adapter = [:test,
Faraday::Adapter::Test::Stubs.new { |f| stubs f }]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment