Sha256: b9543ed6f9274d050f575bc5cf112657af13890d43101727402f3313340b2c65
Contents?: true
Size: 1.51 KB
Versions: 6
Compression:
Stored size: 1.51 KB
Contents
require 'spec_helper' describe 'AllscriptsUnityClient' do include Savon::SpecHelper subject { AllscriptsUnityClient } describe '.create' do context 'when given mode: :soap' do it 'returns a SOAPClient' do parameters = build(:allscripts_unity_client_parameters, mode: :soap) expect(subject.create(parameters).client_type).to be(:soap) end end context 'when given mode: :json' do it 'returns a client with client_type :json' do parameters = build(:allscripts_unity_client_parameters, mode: :json) expect(subject.create(parameters).client_type).to be(:json) end end context 'when not given :mode' do it 'returns a client with client_type :soap' do parameters = build(:allscripts_unity_client_parameters) parameters[:mode] = nil expect(subject.create(parameters).client_type).to be(:soap) end end end describe '.raise_if_options_invalid' do context 'when not given :mode' do it { expect { subject.send(:raise_if_options_invalid, build(:allscripts_unity_client_parameters, mode: nil)) }.to raise_error(ArgumentError) } end context 'when given mode: :json' do it { expect { subject.send(:raise_if_options_invalid, build(:allscripts_unity_client_parameters, mode: :json)) }.not_to raise_error } end context 'when given mode: :soap' do it { expect { subject.send(:raise_if_options_invalid, build(:allscripts_unity_client_parameters, mode: :soap)) }.not_to raise_error } end end end
Version data entries
6 entries across 6 versions & 1 rubygems