Sha256: 6d25034abe41eea17879d464d2837306847386080e3805c339496fd4e8b0a937

Contents?: true

Size: 998 Bytes

Versions: 84

Compression:

Stored size: 998 Bytes

Contents

require 'pact_broker/api/decorators/triggered_webhooks_decorator'
require 'pact_broker/webhooks/triggered_webhook'

module PactBroker
  module Api
    module Decorators
      describe TriggeredWebhooksDecorator do
        let(:triggered_webhook) do
          instance_double(PactBroker::Webhooks::TriggeredWebhook).as_null_object
        end
        let(:decorator) { TriggeredWebhooksDecorator.new([triggered_webhook]) }
        let(:user_options) { { resource_title: "Title", resource_url: "http://url" } }
        let(:json) { decorator.to_json(user_options: user_options) }

        subject { JSON.parse(json) }

        it "includes a self relation" do
          expect(subject['_links']['self']['title']).to eq "Title"
          expect(subject['_links']['self']['href']).to eq "http://url"
        end

        it "includes an embedded list of triggered webhooks" do
          expect(subject['_embedded']['triggeredWebhooks']).to be_instance_of(Array)
        end
      end
    end
  end
end

Version data entries

84 entries across 84 versions & 1 rubygems

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