Sha256: 6ca24a1e4451497473e321411a3a4a964405391c583b75a0a4fe95c2acf46bc8
Contents?: true
Size: 928 Bytes
Versions: 39
Compression:
Stored size: 928 Bytes
Contents
require 'spec_helper.rb' describe Faraday::ApiKey do describe 'error' do stubs = Faraday::Adapter::Test::Stubs.new do |stub| stub.get('/products/123') {[ 200, {foo: 'hi'}, '']} end test = Faraday.new do |builder| builder.request :api_key builder.adapter :test, stubs end it 'should raise a configuration error' do expect { test.get('/products/123') }.to raise_error(Reviewed::ConfigurationError) end end describe 'no error' do stubs = Faraday::Adapter::Test::Stubs.new do |stub| stub.get('/products/123') {[ 200, {foo: 'hi'}, '']} end test = Faraday.new do |builder| builder.request :api_key builder.adapter :test, stubs end test.headers = { "X-Reviewed-Authorization" => '123' } it 'should not raise an error' do expect { test.get('/products/123') }.to_not raise_error end end end
Version data entries
39 entries across 39 versions & 1 rubygems