Sha256: bd7bb7ea9fac0ec7a8995fb22e886775a00d491385053c887a96dc41fd088cb8

Contents?: true

Size: 965 Bytes

Versions: 12

Compression:

Stored size: 965 Bytes

Contents

require "pact_broker/api/decorators/verifiable_pacts_decorator"

module PactBroker
  module Api
    module Decorators
      describe VerifiablePactsDecorator do
        before do
          allow(VerifiablePactDecorator).to receive(:new).and_return(verifiable_pact_decorator)
        end
        let(:verifiable_pact_decorator) { instance_double(VerifiablePactDecorator).as_null_object }
        let(:pact) { double("pact") }
        let(:decorator) { VerifiablePactsDecorator.new([pact]) }
        let(:options) { { user_options: { resource_url: "http://example.org/pacts" } } }

        let(:json) { decorator.to_json(options) }

        subject { JSON.parse(json) }

        it "includes a list of verifiable pacts" do
          expect(subject["_embedded"]["pacts"]).to be_an(Array)
        end

        it "includes a link to itself" do
          expect(subject["_links"]["self"]["href"]).to eq "http://example.org/pacts"
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
pact_broker-2.89.1 spec/lib/pact_broker/api/decorators/verifiable_pacts_decorator_spec.rb
pact_broker-2.89.0 spec/lib/pact_broker/api/decorators/verifiable_pacts_decorator_spec.rb
pact_broker-2.88.0 spec/lib/pact_broker/api/decorators/verifiable_pacts_decorator_spec.rb
pact_broker-2.87.0 spec/lib/pact_broker/api/decorators/verifiable_pacts_decorator_spec.rb
pact_broker-2.86.0 spec/lib/pact_broker/api/decorators/verifiable_pacts_decorator_spec.rb
pact_broker-2.85.1 spec/lib/pact_broker/api/decorators/verifiable_pacts_decorator_spec.rb
pact_broker-2.85.0 spec/lib/pact_broker/api/decorators/verifiable_pacts_decorator_spec.rb
pact_broker-2.84.0 spec/lib/pact_broker/api/decorators/verifiable_pacts_decorator_spec.rb
pact_broker-2.83.0 spec/lib/pact_broker/api/decorators/verifiable_pacts_decorator_spec.rb
pact_broker-2.82.0 spec/lib/pact_broker/api/decorators/verifiable_pacts_decorator_spec.rb
pact_broker-2.81.0 spec/lib/pact_broker/api/decorators/verifiable_pacts_decorator_spec.rb
pact_broker-2.80.0 spec/lib/pact_broker/api/decorators/verifiable_pacts_decorator_spec.rb