Sha256: 47a53c652be2589d4b9663a11e6abfaba0d0c2911fbbf71f624dec09fee6f28c

Contents?: true

Size: 1.11 KB

Versions: 18

Compression:

Stored size: 1.11 KB

Contents

require 'pact_broker/api/decorators/embedded_tag_decorator'
require 'pact_broker/repositories/tag_repository'
require 'support/provider_state_builder'

module PactBroker

  module Api

    module Decorators

      describe EmbeddedTagDecorator do

        let(:tag) do
          ProviderStateBuilder.new
            .create_consumer("Consumer")
            .create_version("1.2.3")
            .create_tag("prod")
          PactBroker::Repositories::TagRepository.new.find tag_name: 'prod', pacticipant_version_number: '1.2.3', pacticipant_name: 'Consumer'
        end

        let(:options) { {base_url: 'http://example.org' }}

        subject { JSON.parse TagDecorator.new(tag).to_json(options), symbolize_names: true }

        it "includes the tag name" do
          expect(subject[:name]).to eq "prod"
        end

        it "includes a link to itself" do
          expect(subject[:_links][:self][:href]).to eq "http://example.org/pacticipants/Consumer/versions/1.2.3/tags/prod"
        end

        it "includes the tag name" do
          expect(subject[:_links][:self][:name]).to eq "prod"
        end

      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
pact_broker-1.14.0 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-1.13.0 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-1.12.0 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-1.11.2 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-1.11.1 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-1.11.0 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-1.10.0 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-1.9.3 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-1.9.2 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-1.9.1 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-1.9.0 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-1.9.0.rc1 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-1.8.1 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-1.8.0 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-1.7.0 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-1.6.0 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-1.5.0 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-1.4.0 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb