Sha256: 871418c772c213d33214a35c2c99cd435d5e183acaa854eab6e8dd1ec3f02b9e

Contents?: true

Size: 938 Bytes

Versions: 17

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

17 entries across 17 versions & 1 rubygems

Version Path
allscripts_unity_client-1.3.4 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-1.3.3 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-1.3.2 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-1.3.1 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-1.3.0 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-1.2.7 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-1.2.6 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-1.2.5 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-1.2.4 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-1.2.3 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-1.2.2 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-1.2.1 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-1.2.0 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-1.1.1 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-1.1.0 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-1.0.4 spec/support/shared_examples_for_unity_response.rb
allscripts_unity_client-1.0.3 spec/support/shared_examples_for_unity_response.rb