spec/balanced_spec.rb in balanced-0.6.0 vs spec/balanced_spec.rb in balanced-0.7.0

- old
+ new

@@ -1,10 +1,22 @@ require "spec_helper" describe Balanced do - describe "configure" do - use_vcr_cassette + describe 'configuring the faraday http adapter' do + it 'sets it to net http when nothing is passed in' do + client = Balanced.configure 'secret' + client.conn.builder.handlers.should include Faraday::Adapter::NetHttp + end + + it 'allows the user to set it' do + client = Balanced.configure 'secret', :faraday_adapter => :net_http_persistent + client.conn.builder.handlers.should include Faraday::Adapter::NetHttpPersistent + client.conn.builder.handlers.should_not include Faraday::Adapter::NetHttp + end + end + + describe "configure", :vcr do before do @api_key = Balanced::ApiKey.new.save Balanced.configure @api_key.secret end @@ -35,20 +47,18 @@ it { should satisfy {|s| ["https://api.balancedpayments.com", "http://localhost:5000"].include?(s) } } end end - describe "reconfigure with new api key" do - use_vcr_cassette + describe "reconfigure with new api key", :vcr do before do @new_api_key = Balanced::ApiKey.new.save Balanced.configure @new_api_key.secret end describe "api key" do - describe "merchant" do - use_vcr_cassette + describe "merchant", :vcr do subject { @api_key.merchant } it { should_not be_nil } end end @@ -64,12 +74,10 @@ describe "secret" do subject { @new_api_key.secret } it { should_not be_nil } end - describe "merchant" do - use_vcr_cassette - + describe "merchant", :vcr do subject { @new_api_key.merchant } it { should_not be_nil } end end end