Sha256: 90c74922e968993e90293ca761101855cf82448d1fa6b1c8e19aee02c043a03e

Contents?: true

Size: 912 Bytes

Versions: 115

Compression:

Stored size: 912 Bytes

Contents

require 'pact_broker/api/decorators/embedded_label_decorator'

module PactBroker
  module Api
    module Decorators

      describe LabelDecorator do

        let(:label) do
          TestDataBuilder.new
            .create_consumer("Consumer")
            .create_label("ios")
            .and_return(:label)
        end

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

        subject { JSON.parse EmbeddedLabelDecorator.new(label).to_json(options), symbolize_names: true }

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

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

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

Version data entries

115 entries across 115 versions & 1 rubygems

Version Path
pact_broker-2.36.1 spec/lib/pact_broker/api/decorators/embedded_label_decorator_spec.rb
pact_broker-2.36.0 spec/lib/pact_broker/api/decorators/embedded_label_decorator_spec.rb
pact_broker-2.35.0 spec/lib/pact_broker/api/decorators/embedded_label_decorator_spec.rb
pact_broker-2.34.0 spec/lib/pact_broker/api/decorators/embedded_label_decorator_spec.rb
pact_broker-2.33.0 spec/lib/pact_broker/api/decorators/embedded_label_decorator_spec.rb
pact_broker-2.32.0 spec/lib/pact_broker/api/decorators/embedded_label_decorator_spec.rb
pact_broker-2.31.0 spec/lib/pact_broker/api/decorators/embedded_label_decorator_spec.rb
pact_broker-2.30.0 spec/lib/pact_broker/api/decorators/embedded_label_decorator_spec.rb
pact_broker-2.29.0 spec/lib/pact_broker/api/decorators/embedded_label_decorator_spec.rb
pact_broker-2.27.6 spec/lib/pact_broker/api/decorators/embedded_label_decorator_spec.rb
pact_broker-2.27.5 spec/lib/pact_broker/api/decorators/embedded_label_decorator_spec.rb
pact_broker-2.27.4 spec/lib/pact_broker/api/decorators/embedded_label_decorator_spec.rb
pact_broker-2.27.3 spec/lib/pact_broker/api/decorators/embedded_label_decorator_spec.rb
pact_broker-2.27.2 spec/lib/pact_broker/api/decorators/embedded_label_decorator_spec.rb
pact_broker-2.27.0 spec/lib/pact_broker/api/decorators/embedded_label_decorator_spec.rb
pact_broker-2.26.1 spec/lib/pact_broker/api/decorators/embedded_label_decorator_spec.rb
pact_broker-2.26.0 spec/lib/pact_broker/api/decorators/embedded_label_decorator_spec.rb
pact_broker-2.25.0 spec/lib/pact_broker/api/decorators/embedded_label_decorator_spec.rb
pact_broker-2.24.0 spec/lib/pact_broker/api/decorators/embedded_label_decorator_spec.rb
pact_broker-2.23.4 spec/lib/pact_broker/api/decorators/embedded_label_decorator_spec.rb