Sha256: 9a96e6d5ea7cf7253855de03f32f1d8230f365fa94a0b23dfb3753ba37ebde36

Contents?: true

Size: 956 Bytes

Versions: 13

Compression:

Stored size: 956 Bytes

Contents

require 'spec_helper'

describe AllscriptsUnityClient do
  subject { described_class }

  describe '.create' do
    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 :json' do
        parameters = build(:allscripts_unity_client_parameters)
        parameters[:mode] = nil
        expect(subject.create(parameters).client_type).to be(:json)
      end
    end

    context 'when given an invalid :mode' do
      it 'raises an argument error' do
        parameters = build(:allscripts_unity_client_parameters)
        parameters[:mode] = :cheese
        expect { subject.create(parameters) }.to raise_error(ArgumentError, ':mode must be :json')
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
allscripts_unity_client-4.0.0 spec/allscripts_unity_client_spec.rb
allscripts_unity_client-3.4.1 spec/allscripts_unity_client_spec.rb
allscripts_unity_client-3.4.0 spec/allscripts_unity_client_spec.rb
allscripts_unity_client-3.3.1 spec/allscripts_unity_client_spec.rb
allscripts_unity_client-3.3.0 spec/allscripts_unity_client_spec.rb
allscripts_unity_client-3.2.2 spec/allscripts_unity_client_spec.rb
allscripts_unity_client-3.2.1 spec/allscripts_unity_client_spec.rb
allscripts_unity_client-3.2.0 spec/allscripts_unity_client_spec.rb
allscripts_unity_client-3.1.3 spec/allscripts_unity_client_spec.rb
allscripts_unity_client-3.1.2 spec/allscripts_unity_client_spec.rb
allscripts_unity_client-3.1.1 spec/allscripts_unity_client_spec.rb
allscripts_unity_client-3.1.0 spec/allscripts_unity_client_spec.rb
allscripts_unity_client-3.0.0 spec/allscripts_unity_client_spec.rb