Sha256: f14e6fc304522cc959a59aa47d486c36802dc053b6f2eafeae8758789162a056

Contents?: true

Size: 1.13 KB

Versions: 124

Compression:

Stored size: 1.13 KB

Contents

# Tests the backwards compatibility of our master -> server changes
# in the HTTP API
# This may be removed in Puppet 8
require 'spec_helper'

require 'puppet/network/http'
require 'puppet_spec/network'

describe Puppet::Network::HTTP::API::Master::V3 do
  include PuppetSpec::Network

  let(:response) { Puppet::Network::HTTP::MemoryResponse.new }
  let(:server_url_prefix) { "#{Puppet::Network::HTTP::MASTER_URL_PREFIX}/v3" }
  let(:server_routes) {
    Puppet::Network::HTTP::Route.
        path(Regexp.new("#{Puppet::Network::HTTP::MASTER_URL_PREFIX}/")).
        any.
        chain(Puppet::Network::HTTP::API::Master::V3.routes)
  }

  # simulate puppetserver registering its authconfigloader class
  around :each do |example|
    Puppet::Network::Authorization.authconfigloader_class = Object
    begin
      example.run
    ensure
      Puppet::Network::Authorization.authconfigloader_class = nil
    end
  end

  it "mounts the environments endpoint" do
    request = Puppet::Network::HTTP::Request.from_hash(:path => "#{server_url_prefix}/environments")
    server_routes.process(request, response)

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

Version data entries

124 entries across 124 versions & 1 rubygems

Version Path
puppet-7.10.0 spec/unit/network/http/api/master_spec.rb
puppet-7.10.0-x86-mingw32 spec/unit/network/http/api/master_spec.rb
puppet-7.10.0-x64-mingw32 spec/unit/network/http/api/master_spec.rb
puppet-7.10.0-universal-darwin spec/unit/network/http/api/master_spec.rb
puppet-7.9.0 spec/unit/network/http/api/master_spec.rb
puppet-7.9.0-x86-mingw32 spec/unit/network/http/api/master_spec.rb
puppet-7.9.0-x64-mingw32 spec/unit/network/http/api/master_spec.rb
puppet-7.9.0-universal-darwin spec/unit/network/http/api/master_spec.rb
puppet-7.8.0 spec/unit/network/http/api/master_spec.rb
puppet-7.8.0-x86-mingw32 spec/unit/network/http/api/master_spec.rb
puppet-7.8.0-x64-mingw32 spec/unit/network/http/api/master_spec.rb
puppet-7.8.0-universal-darwin spec/unit/network/http/api/master_spec.rb
puppet-7.7.0 spec/unit/network/http/api/master_spec.rb
puppet-7.7.0-x86-mingw32 spec/unit/network/http/api/master_spec.rb
puppet-7.7.0-x64-mingw32 spec/unit/network/http/api/master_spec.rb
puppet-7.7.0-universal-darwin spec/unit/network/http/api/master_spec.rb
puppet-7.6.1 spec/unit/network/http/api/master_spec.rb
puppet-7.6.1-x86-mingw32 spec/unit/network/http/api/master_spec.rb
puppet-7.6.1-x64-mingw32 spec/unit/network/http/api/master_spec.rb
puppet-7.6.1-universal-darwin spec/unit/network/http/api/master_spec.rb