Sha256: 6e27aa9b215272adeb51f91afb2a36b58d035fecca32f3cbdeab75549f896170

Contents?: true

Size: 939 Bytes

Versions: 49

Compression:

Stored size: 939 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

describe LHC::Endpoint do
  context 'placeholders' do
    it 'returns all placeholders alphabetically sorted' do
      endpoint = LHC::Endpoint.new('{+datastore}/v2/{campaign_id}/feedbacks')
      expect(
        endpoint.placeholders
      ).to eq [:campaign_id, :datastore]
    end

    it 'allows basic auth token in url, like used on github' do
      stub_request(:get, "https://d123token:@api.github.com/search")
        .to_return(body: {}.to_json)
      expect(-> {
        LHC.get("https://d123token:@api.github.com/search")
      }).not_to raise_error
    end

    it 'allows complete basic auth (username password) in url, like used for the gemserer' do
      stub_request(:get, "https://name:password@gemserver.com")
        .to_return(body: {}.to_json)
      expect(-> {
        LHC.get("https://name:password@gemserver.com")
      }).not_to raise_error
    end
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
lhc-10.4.0 spec/endpoint/placeholders_spec.rb
lhc-10.3.0 spec/endpoint/placeholders_spec.rb
lhc-10.2.1 spec/endpoint/placeholders_spec.rb
lhc-10.2.0 spec/endpoint/placeholders_spec.rb
lhc-10.1.8 spec/endpoint/placeholders_spec.rb
lhc-10.1.7 spec/endpoint/placeholders_spec.rb
lhc-10.1.6 spec/endpoint/placeholders_spec.rb
lhc-10.1.5 spec/endpoint/placeholders_spec.rb
lhc-10.1.3 spec/endpoint/placeholders_spec.rb