Sha256: 27515ab3d296e5ab17197b7238da89fdbee9bccd81098364f5d1305d6ff705dc

Contents?: true

Size: 671 Bytes

Versions: 63

Compression:

Stored size: 671 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

describe LHS::Record do

  context 'endpoint priorities' do

    before do
      class Record < LHS::Record
        endpoint 'https://api/v2/feedbacks'
        endpoint 'https://api/v2/reviews'
        endpoint 'https://api/v2/streets/{id}'
        endpoint 'https://api/v2/feedbacks/{id}'
        endpoint 'https://api/v2/reviews/{id}'
      end
    end

    it 'always takes the first endpoint found' do
      stub_request(:get, "https://api/v2/feedbacks").to_return(status: 200)
      Record.fetch
      stub_request(:get, "https://api/v2/streets/1").to_return(status: 200)
      Record.find(1)
    end
  end
end

Version data entries

63 entries across 63 versions & 1 rubygems

Version Path
lhs-26.2.0 spec/record/endpoint_priorities_spec.rb
lhs-26.1.0 spec/record/endpoint_priorities_spec.rb
lhs-26.0.1 spec/record/endpoint_priorities_spec.rb
lhs-26.0.0 spec/record/endpoint_priorities_spec.rb
lhs-25.2.0 spec/record/endpoint_priorities_spec.rb
lhs-25.1.0 spec/record/endpoint_priorities_spec.rb
lhs-25.0.4 spec/record/endpoint_priorities_spec.rb
lhs-25.0.3 spec/record/endpoint_priorities_spec.rb
lhs-25.0.2 spec/record/endpoint_priorities_spec.rb
lhs-25.0.1 spec/record/endpoint_priorities_spec.rb
lhs-25.0.0 spec/record/endpoint_priorities_spec.rb
lhs-24.1.2 spec/record/endpoint_priorities_spec.rb
lhs-24.1.1 spec/record/endpoint_priorities_spec.rb
lhs-24.1.0 spec/record/endpoint_priorities_spec.rb
lhs-24.1.0.pre.2 spec/record/endpoint_priorities_spec.rb
lhs-24.1.0.pre.1 spec/record/endpoint_priorities_spec.rb
lhs-24.0.0 spec/record/endpoint_priorities_spec.rb
lhs-23.0.2 spec/record/endpoint_priorities_spec.rb
lhs-23.0.1 spec/record/endpoint_priorities_spec.rb
lhs-23.0.0 spec/record/endpoint_priorities_spec.rb