Sha256: 615c79a179a947949de9e04226761d305abfb537b826ceb9dfd47938ba38f2d2

Contents?: true

Size: 1.01 KB

Versions: 7

Compression:

Stored size: 1.01 KB

Contents

require "pact_broker/deployments/environment_service"

module PactBroker
  module Deployments
    module EnvironmentService
      describe ".create" do
        let(:environment) do
          Environment.new(
            name: "foo",
            display_name: display_name,
            production: false
          )
        end

        let(:display_name) { "Foo" }

        subject { EnvironmentService.create("1234", environment) }

        it "creates the environment" do
          subject
          expect(subject.name).to eq "foo"
          expect(subject.display_name).to eq "Foo"
          expect(subject.production).to eq false
        end

        context "when the display name is blank or not set" do
          let(:display_name) { " " }

          it "generates a display name" do
            expect(PactBroker::Pacticipants::GenerateDisplayName).to receive(:call).with("foo").and_return("Display Name")
            expect(subject.display_name).to eq "Display Name"
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pact_broker-2.85.1 spec/lib/pact_broker/deployments/environment_service_spec.rb
pact_broker-2.85.0 spec/lib/pact_broker/deployments/environment_service_spec.rb
pact_broker-2.84.0 spec/lib/pact_broker/deployments/environment_service_spec.rb
pact_broker-2.83.0 spec/lib/pact_broker/deployments/environment_service_spec.rb
pact_broker-2.82.0 spec/lib/pact_broker/deployments/environment_service_spec.rb
pact_broker-2.81.0 spec/lib/pact_broker/deployments/environment_service_spec.rb
pact_broker-2.80.0 spec/lib/pact_broker/deployments/environment_service_spec.rb