Sha256: 3b403127229a2d3b0214ce177a16229ffe2904b3fc61932c795c55567b1468da

Contents?: true

Size: 1.24 KB

Versions: 12

Compression:

Stored size: 1.24 KB

Contents

require "pact_broker/api/resources/can_i_deploy_pacticipant_version"
require "pact_broker/matrix/service"

module PactBroker
  module Api
    module Resources
      describe CanIDeployPacticipantVersion do
        include_context "stubbed services"

        before do
          allow(PactBroker::Matrix::Service).to receive(:can_i_deploy).and_return([])
          allow(pacticipant_service).to receive(:find_pacticipant_by_name).and_return(pacticipant)
          allow(version_service).to receive(:find_by_pacticipant_name_and_latest_tag).and_return(version)
          allow(PactBroker::Api::Decorators::MatrixDecorator).to receive(:new).and_return(decorator)
        end

        let(:pacticipant) { double("pacticipant") }
        let(:version) { double("version") }
        let(:path) { "/pacticipants/Foo/latest-version/main/can-i-deploy/to/prod" }
        let(:json_response_body) { JSON.parse(subject.body, symbolize_names: true) }
        let(:decorator) { double("decorator", to_json: "response_body") }
        let(:selectors) { double("selectors") }
        let(:options) { double("options") }

        subject { get(path, nil, "Content-Type" => "application/hal+json") }

        it { is_expected.to be_a_hal_json_success_response }
      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/resources/can_i_deploy_pacticipant_version_spec.rb
pact_broker-2.89.0 spec/lib/pact_broker/api/resources/can_i_deploy_pacticipant_version_spec.rb
pact_broker-2.88.0 spec/lib/pact_broker/api/resources/can_i_deploy_pacticipant_version_spec.rb
pact_broker-2.87.0 spec/lib/pact_broker/api/resources/can_i_deploy_pacticipant_version_spec.rb
pact_broker-2.86.0 spec/lib/pact_broker/api/resources/can_i_deploy_pacticipant_version_spec.rb
pact_broker-2.85.1 spec/lib/pact_broker/api/resources/can_i_deploy_pacticipant_version_spec.rb
pact_broker-2.85.0 spec/lib/pact_broker/api/resources/can_i_deploy_pacticipant_version_spec.rb
pact_broker-2.84.0 spec/lib/pact_broker/api/resources/can_i_deploy_pacticipant_version_spec.rb
pact_broker-2.83.0 spec/lib/pact_broker/api/resources/can_i_deploy_pacticipant_version_spec.rb
pact_broker-2.82.0 spec/lib/pact_broker/api/resources/can_i_deploy_pacticipant_version_spec.rb
pact_broker-2.81.0 spec/lib/pact_broker/api/resources/can_i_deploy_pacticipant_version_spec.rb
pact_broker-2.80.0 spec/lib/pact_broker/api/resources/can_i_deploy_pacticipant_version_spec.rb