Sha256: 05b7dd917968a4b342e03c75704459f892a323e9eb73db86fde186b522159c02

Contents?: true

Size: 1.14 KB

Versions: 117

Compression:

Stored size: 1.14 KB

Contents

require 'pact_broker/api/decorators/embedded_tag_decorator'
require 'pact_broker/tags/repository'
require 'support/test_data_builder'

module PactBroker

  module Api

    module Decorators

      describe EmbeddedTagDecorator do

        let(:tag) do
          TestDataBuilder.new
            .create_consumer("Consumer")
            .create_version("1.2.3")
            .create_tag("prod")
          PactBroker::Tags::Repository.new.find(tag_name: 'prod', pacticipant_version_number: '1.2.3', pacticipant_name: 'Consumer')
        end

        let(:options) { { user_options: { base_url: 'http://example.org' } } }
        let(:json) { EmbeddedTagDecorator.new(tag).to_json(options) }

        subject { JSON.parse json, 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

117 entries across 117 versions & 1 rubygems

Version Path
pact_broker-2.79.1 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-2.79.0 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-2.78.1 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-2.78.0 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-2.77.0 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-2.76.2 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-2.76.1 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-2.76.0 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-2.75.0 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-2.74.1 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-2.74.0 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-2.73.0 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-2.72.0 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-2.71.0 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-2.70.0 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-2.69.0 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-2.68.1 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-2.68.0 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-2.67.0 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb
pact_broker-2.66.0 spec/lib/pact_broker/api/decorators/embedded_tag_decorator_spec.rb