summaryrefslogtreecommitdiff
path: root/spec/unit/network/http/api/v2_spec.rb
blob: 30cbaaac054ba1d3c351e86d3f31d2eb4f3419fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
require 'spec_helper'

require 'puppet/network/http'

describe Puppet::Network::HTTP::API::V2 do
  it "responds to unknown paths with a 404" do
    response = Puppet::Network::HTTP::MemoryResponse.new
    request = Puppet::Network::HTTP::Request.from_hash(:path => "/v2.0/unknown")

    expect do
      Puppet::Network::HTTP::API::V2.routes.process(request, response)
    end.to raise_error(Puppet::Network::HTTP::Error::HTTPNotFoundError)
  end
end