Sha256: 4e326f195c7796e894dcf8a2f70343bae18d7c0e1a42368af9ee8cc6646645e3

Contents?: true

Size: 609 Bytes

Versions: 12

Compression:

Stored size: 609 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

describe DHS::Item do
  context 'nested data' do
    before do
      class Presence < DHS::Record
        endpoint 'http://opm/presences'
      end
      stub_request(:post, 'http://opm/presences')
        .to_return(
          body: {
            listings: [{ status: 'CONNECTED' }],
            field_errors: []
          }.to_json
        )
    end

    it 'does not raise when accessing nested data' do
      presence = Presence.create
      expect(lambda {
        presence.listings.first
      }).not_to raise_error NoMethodError
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
dhs-1.6.0 spec/item/nested_errors_spec.rb
dhs-1.5.0 spec/item/nested_errors_spec.rb
dhs-1.4.2 spec/item/nested_errors_spec.rb
dhs-1.4.1 spec/item/nested_errors_spec.rb
dhs-1.4.0 spec/item/nested_errors_spec.rb
dhs-1.3.0 spec/item/nested_errors_spec.rb
dhs-1.2.0 spec/item/nested_errors_spec.rb
dhs-1.1.0 spec/item/nested_errors_spec.rb
dhs-1.0.3 spec/item/nested_errors_spec.rb
dhs-1.0.2 spec/item/nested_errors_spec.rb
dhs-1.0.1 spec/item/nested_errors_spec.rb
dhs-1.0.0 spec/item/nested_errors_spec.rb