Sha256: 6856bc042772646f2905eea34798adf3b45075a1444acb46f2b3e82aa2500efd

Contents?: true

Size: 938 Bytes

Versions: 29

Compression:

Stored size: 938 Bytes

Contents

shared_examples 'a unity response' do
  let(:attributes_hash) { FixtureLoader.load_yaml('attributes_hash.yml') }
  let(:no_attributes_hash) { FixtureLoader.load_yaml('no_attributes_hash.yml') }
  let(:date_string_hash) { FixtureLoader.load_yaml('date_string_hash.yml') }
  let(:date_hash) { FixtureLoader.load_yaml('date_hash.yml') }

  describe '#strip_attributes' do
    context 'when given nil' do
      it { expect(subject.send(:strip_attributes, nil)).to be_nil }
    end

    it 'recursively strips attribute keys off hashes' do
      expect(subject.send(:strip_attributes, attributes_hash)).to eq(no_attributes_hash)
    end
  end

  describe '#convert_dates_to_utc' do
    context 'when given nil' do
      it { expect(subject.send(:convert_dates_to_utc, nil)).to be_nil }
    end

    it 'recursively converts date strings' do
      expect(subject.send(:convert_dates_to_utc, date_string_hash)).to eq(date_hash)
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
allscripts_unity_client-3.4.1 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-3.4.0 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-3.3.1 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-3.3.0 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-3.2.2 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-3.2.1 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-3.2.0 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-3.1.3 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-3.1.2 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-3.1.1 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-3.1.0 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-3.0.0 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-2.2.4 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-2.2.3 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-2.2.2 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-2.2.0 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-2.1.6 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-2.1.5 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-2.1.4 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-2.1.3 spec/support/shared_examples_for_unity_response.rb