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