Sha256: 589f695db573f7a994e8cb2b9b571ba95bf08131f4cacf9311eb674aa806529a

Contents?: true

Size: 763 Bytes

Versions: 28

Compression:

Stored size: 763 Bytes

Contents

require 'rails_helper'

describe LHS::Item do

  context 'make errors available' do

    before(:each) do
      class Presence < LHS::Record
        endpoint 'http://opm/presences'
      end
    end

    let(:place_href) { 'http://datastore/places/1' }

    it 'makes errors available no matter the response code' do
      stub_request(:post, "http://opm/presences")
        .to_return(
          status: 200,
          body: {
            place: { href: place_href },
            field_errors: [{
              code: 'REQUIRED_PROPERTY_VALUE',
              path: ['place', 'opening_hours']
            }]
          }.to_json
        )
      presence = Presence.create(place: { href: place_href })
      expect(presence.errors.any?).to be true
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
lhs-15.3.1 spec/item/access_errors_spec.rb
lhs-15.3.1.pre.fixlhc.1 spec/item/access_errors_spec.rb
lhs-15.3.0 spec/item/access_errors_spec.rb
lhs-15.2.5 spec/item/access_errors_spec.rb
lhs-15.2.4 spec/item/access_errors_spec.rb
lhs-15.2.3 spec/item/access_errors_spec.rb
lhs-15.2.3.pre.favorites.1 spec/item/access_errors_spec.rb
lhs-15.2.2.pre.favorites.1 spec/item/access_errors_spec.rb
lhs-15.2.2 spec/item/access_errors_spec.rb
lhs-15.2.1 spec/item/access_errors_spec.rb
lhs-15.2.0 spec/item/access_errors_spec.rb
lhs-15.1.1 spec/item/access_errors_spec.rb
lhs-15.1.0 spec/item/access_errors_spec.rb
lhs-15.0.2 spec/item/access_errors_spec.rb
lhs-15.0.1 spec/item/access_errors_spec.rb
lhs-15.0.0 spec/item/access_errors_spec.rb
lhs-14.6.5 spec/item/access_errors_spec.rb
lhs-14.6.4 spec/item/access_errors_spec.rb
lhs-14.6.3 spec/item/access_errors_spec.rb
lhs-14.6.2 spec/item/access_errors_spec.rb