Sha256: b6099e77a259c7db1ad5875e5c4c06ea795524d65a7a5648e0df1526fda34188

Contents?: true

Size: 834 Bytes

Versions: 19

Compression:

Stored size: 834 Bytes

Contents

require 'rails_helper'

describe LHS::Endpoint do
  context 'for url' do
    before do
      class Record < LHS::Record
        endpoint '{+datastore}/entries/{entry_id}/content-ads/{campaign_id}/feedbacks'
        endpoint '{+datastore}/{campaign_id}/feedbacks'
        endpoint '{+datastore}/feedbacks'
      end
    end

    it 'provides the endpoint for a given url' do
      expect(
        LHS::Endpoint.for_url('http://local.ch/v2/entries/123/content-ads/456/feedbacks').url
      ).to eq '{+datastore}/entries/{entry_id}/content-ads/{campaign_id}/feedbacks'
      expect(
        LHS::Endpoint.for_url('http://local.ch/123/feedbacks').url
      ).to eq '{+datastore}/{campaign_id}/feedbacks'
      expect(
        LHS::Endpoint.for_url('http://local.ch/feedbacks').url
      ).to eq '{+datastore}/feedbacks'
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
lhs-16.1.5 spec/endpoint/for_url_spec.rb
lhs-16.1.4 spec/endpoint/for_url_spec.rb
lhs-16.1.3 spec/endpoint/for_url_spec.rb
lhs-16.1.2 spec/endpoint/for_url_spec.rb
lhs-16.1.1 spec/endpoint/for_url_spec.rb
lhs-16.1.0 spec/endpoint/for_url_spec.rb
lhs-16.0.1 spec/endpoint/for_url_spec.rb
lhs-16.0.0 spec/endpoint/for_url_spec.rb
lhs-15.7.0 spec/endpoint/for_url_spec.rb
lhs-15.6.1 spec/endpoint/for_url_spec.rb
lhs-15.6.0 spec/endpoint/for_url_spec.rb
lhs-15.5.1 spec/endpoint/for_url_spec.rb
lhs-15.5.0 spec/endpoint/for_url_spec.rb
lhs-15.4.1 spec/endpoint/for_url_spec.rb
lhs-15.4.0 spec/endpoint/for_url_spec.rb
lhs-15.4.0.pre.hasone.1 spec/endpoint/for_url_spec.rb
lhs-15.3.3 spec/endpoint/for_url_spec.rb
lhs-15.3.3.pre.fixoptions.1 spec/endpoint/for_url_spec.rb
lhs-15.3.2 spec/endpoint/for_url_spec.rb