Sha256: ab92e46a31726e83ee97456982ee5d7946fbf5c1dbde209c3e9e5492e0fb9fa4

Contents?: true

Size: 908 Bytes

Versions: 13

Compression:

Stored size: 908 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

13 entries across 13 versions & 1 rubygems

Version Path
lhc-10.1.2 spec/endpoint/placeholders_spec.rb
lhc-10.1.1 spec/endpoint/placeholders_spec.rb
lhc-10.1.0 spec/endpoint/placeholders_spec.rb
lhc-10.0.2 spec/endpoint/placeholders_spec.rb
lhc-9.4.4 spec/endpoint/placeholders_spec.rb
lhc-10.0.1 spec/endpoint/placeholders_spec.rb
lhc-10.0.0 spec/endpoint/placeholders_spec.rb
lhc-9.4.3 spec/endpoint/placeholders_spec.rb
lhc-9.4.2 spec/endpoint/placeholders_spec.rb
lhc-9.4.1 spec/endpoint/placeholders_spec.rb
lhc-9.4.0 spec/endpoint/placeholders_spec.rb
lhc-9.3.1 spec/endpoint/placeholders_spec.rb
lhc-9.3.0 spec/endpoint/placeholders_spec.rb