Sha256: 71e41ae545c47e8efe146a65d2aa63424bb56eebadf5cd5eabb5cb1a5ef4307a
Contents?: true
Size: 829 Bytes
Versions: 44
Compression:
Stored size: 829 Bytes
Contents
require 'rails_helper' describe LHC::Request do it 'compiles url in case of configured endpoints' do options = { params: { has_reviews: true } } url = 'http://datastore/v2/campaign/:campaign_id/feedbacks' LHC.configure { |c| c.endpoint(:feedbacks, url, options) } stub_request(:get, 'http://datastore/v2/campaign/123/feedbacks?has_reviews=true') LHC.get(:feedbacks, params: { campaign_id: 123 }) end it 'compiles url when doing a request' do stub_request(:get, 'http://datastore:8080/v2/feedbacks/123') LHC.get('http://datastore:8080/v2/feedbacks/:id', params: { id: 123 }) end it 'considers body when compiling urls' do stub_request(:post, "http://datastore:8080/v2/places/123") LHC.json.post('http://datastore:8080/v2/places/:id', body: { id: 123 }.to_json) end end
Version data entries
44 entries across 44 versions & 1 rubygems