Sha256: 4ce86ac941a57e5107a6acd7b2efda32c3d84826c844bd6cfb5c13dc67274c67

Contents?: true

Size: 841 Bytes

Versions: 16

Compression:

Stored size: 841 Bytes

Contents

require 'rails_helper'

describe LHS::Endpoint do
  context 'for url' do
    before(:each) 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

16 entries across 16 versions & 1 rubygems

Version Path
lhs-15.3.1 spec/endpoint/for_url_spec.rb
lhs-15.3.1.pre.fixlhc.1 spec/endpoint/for_url_spec.rb
lhs-15.3.0 spec/endpoint/for_url_spec.rb
lhs-15.2.5 spec/endpoint/for_url_spec.rb
lhs-15.2.4 spec/endpoint/for_url_spec.rb
lhs-15.2.3 spec/endpoint/for_url_spec.rb
lhs-15.2.3.pre.favorites.1 spec/endpoint/for_url_spec.rb
lhs-15.2.2.pre.favorites.1 spec/endpoint/for_url_spec.rb
lhs-15.2.2 spec/endpoint/for_url_spec.rb
lhs-15.2.1 spec/endpoint/for_url_spec.rb
lhs-15.2.0 spec/endpoint/for_url_spec.rb
lhs-15.1.1 spec/endpoint/for_url_spec.rb
lhs-15.1.0 spec/endpoint/for_url_spec.rb
lhs-15.0.2 spec/endpoint/for_url_spec.rb
lhs-15.0.1 spec/endpoint/for_url_spec.rb
lhs-15.0.0 spec/endpoint/for_url_spec.rb