Sha256: b615f01811d8c3ff7482a0a156062787a005b64c414e66d17cff348e220a97d3

Contents?: true

Size: 876 Bytes

Versions: 39

Compression:

Stored size: 876 Bytes

Contents

require 'rails_helper'

describe LHC::Endpoint do
  context 'values_as_params' do
    it 'provides params extracting values from a provided url and template' do
      [
        [':datastore/v2/places', 'http://local.ch:8082/v2/places', {
          datastore: 'http://local.ch:8082'
        }],
        [':datastore/v2/places/:id', 'http://local.ch:8082/v2/places/ZW9OJyrbt4OZE9ueu80w-A', {
          datastore: 'http://local.ch:8082',
          id: 'ZW9OJyrbt4OZE9ueu80w-A'
        }],
        [':datastore/v2/places/:namespace/:id', 'http://local.ch:8082/v2/places/switzerland/ZW9OJyrbt', {
          datastore: 'http://local.ch:8082',
          namespace: 'switzerland',
          id: 'ZW9OJyrbt'
        }]
      ].each do |example|
        params = LHC::Endpoint.values_as_params(example[0], example[1])
        expect(params).to eq example[2]
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
lhc-6.7.2 spec/endpoint/values_as_params_spec.rb
lhc-6.7.1 spec/endpoint/values_as_params_spec.rb
lhc-6.7.0 spec/endpoint/values_as_params_spec.rb
lhc-6.6.0.zipkin.pre.03 spec/endpoint/values_as_params_spec.rb
lhc-6.6.0.zipkin.pre.02 spec/endpoint/values_as_params_spec.rb
lhc-6.6.0.zipkin.pre.01 spec/endpoint/values_as_params_spec.rb
lhc-6.6.0.zipkin.pre spec/endpoint/values_as_params_spec.rb
lhc-6.6.0 spec/endpoint/values_as_params_spec.rb
lhc-6.5.0 spec/endpoint/values_as_params_spec.rb
lhc-6.4.0 spec/endpoint/values_as_params_spec.rb
lhc-6.3.1 spec/endpoint/values_as_params_spec.rb
lhc-6.3.0 spec/endpoint/values_as_params_spec.rb
lhc-6.2.0 spec/endpoint/values_as_params_spec.rb
lhc-6.1.3 spec/endpoint/values_as_params_spec.rb
lhc-6.1.2 spec/endpoint/values_as_params_spec.rb
lhc-6.1.1 spec/endpoint/values_as_params_spec.rb
lhc-6.1.0 spec/endpoint/values_as_params_spec.rb
lhc-6.0.1 spec/endpoint/values_as_params_spec.rb
lhc-6.0.0 spec/endpoint/values_as_params_spec.rb
lhc-5.1.1 spec/endpoint/values_as_params_spec.rb