Sha256: 3affb3e2f8c357b6fc7b5b381a73edb3ac1042d8284bf1d7040cb832d145fc9a

Contents?: true

Size: 831 Bytes

Versions: 234

Compression:

Stored size: 831 Bytes

Contents

require 'spec_helper'

require 'puppet/network/http'

describe Puppet::Network::HTTP::API::CA::V1 do
  let(:response) { Puppet::Network::HTTP::MemoryResponse.new }
  let(:ca_url_prefix) { "#{Puppet::Network::HTTP::CA_URL_PREFIX}/v1"}

  let(:ca_routes) {
    Puppet::Network::HTTP::Route.
      path(Regexp.new("#{Puppet::Network::HTTP::CA_URL_PREFIX}/")).
      any.
      chain(Puppet::Network::HTTP::API::CA::V1.routes)
  }

  it "mounts ca routes" do
    Puppet::SSL::Certificate.indirection.stubs(:find).returns "foo"
    request = Puppet::Network::HTTP::Request.
        from_hash(:path => "#{ca_url_prefix}/certificate/foo",
                  :params => {:environment => "production"},
                  :headers => {"accept" => "s"})
    ca_routes.process(request, response)

    expect(response.code).to eq(200)
  end
end

Version data entries

234 entries across 234 versions & 1 rubygems

Version Path
puppet-5.5.12 spec/unit/network/http/api/ca/v1_spec.rb
puppet-5.5.12-x86-mingw32 spec/unit/network/http/api/ca/v1_spec.rb
puppet-5.5.12-x64-mingw32 spec/unit/network/http/api/ca/v1_spec.rb
puppet-5.5.12-universal-darwin spec/unit/network/http/api/ca/v1_spec.rb
puppet-5.5.10 spec/unit/network/http/api/ca/v1_spec.rb
puppet-5.5.10-x86-mingw32 spec/unit/network/http/api/ca/v1_spec.rb
puppet-5.5.10-x64-mingw32 spec/unit/network/http/api/ca/v1_spec.rb
puppet-5.5.10-universal-darwin spec/unit/network/http/api/ca/v1_spec.rb
puppet-5.5.8 spec/unit/network/http/api/ca/v1_spec.rb
puppet-5.5.8-x86-mingw32 spec/unit/network/http/api/ca/v1_spec.rb
puppet-5.5.8-x64-mingw32 spec/unit/network/http/api/ca/v1_spec.rb
puppet-5.5.8-universal-darwin spec/unit/network/http/api/ca/v1_spec.rb
puppet-5.5.7 spec/unit/network/http/api/ca/v1_spec.rb
puppet-5.5.7-x86-mingw32 spec/unit/network/http/api/ca/v1_spec.rb
puppet-5.5.7-x64-mingw32 spec/unit/network/http/api/ca/v1_spec.rb
puppet-5.5.7-universal-darwin spec/unit/network/http/api/ca/v1_spec.rb
puppet-5.5.6 spec/unit/network/http/api/ca/v1_spec.rb
puppet-5.5.6-x86-mingw32 spec/unit/network/http/api/ca/v1_spec.rb
puppet-5.5.6-x64-mingw32 spec/unit/network/http/api/ca/v1_spec.rb
puppet-5.5.6-universal-darwin spec/unit/network/http/api/ca/v1_spec.rb