Sha256: c91962cb6d9c0d9088d4ac5a2dfaa97654ecd8521f3e0648cbc40212dc788c62

Contents?: true

Size: 906 Bytes

Versions: 18

Compression:

Stored size: 906 Bytes

Contents

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

18 entries across 18 versions & 1 rubygems

Version Path
lhc-9.2.0 spec/endpoint/placeholders_spec.rb
lhc-9.1.2 spec/endpoint/placeholders_spec.rb
lhc-9.1.2.pre spec/endpoint/placeholders_spec.rb
lhc-9.1.1 spec/endpoint/placeholders_spec.rb
lhc-8.1.1 spec/endpoint/placeholders_spec.rb
lhc-9.1.0 spec/endpoint/placeholders_spec.rb
lhc-9.0.0 spec/endpoint/placeholders_spec.rb
lhc-8.1.0 spec/endpoint/placeholders_spec.rb
lhc-8.0.0 spec/endpoint/placeholders_spec.rb
lhc-7.3.3 spec/endpoint/placeholders_spec.rb
lhc-7.3.2 spec/endpoint/placeholders_spec.rb
lhc-7.3.1 spec/endpoint/placeholders_spec.rb
lhc-7.3.0 spec/endpoint/placeholders_spec.rb
lhc-7.2.0 spec/endpoint/placeholders_spec.rb
lhc-7.1.0 spec/endpoint/placeholders_spec.rb
lhc-7.0.1 spec/endpoint/placeholders_spec.rb
lhc-7.0.0 spec/endpoint/placeholders_spec.rb
lhc-7.0.0.beta1 spec/endpoint/placeholders_spec.rb