Sha256: 10c2830895ea30ea2de91ac54b4c565b06fbd4e5cedb325ca60a2eb1aff59dca

Contents?: true

Size: 1.13 KB

Versions: 8

Compression:

Stored size: 1.13 KB

Contents

describe "Creating a tag" do
  let(:path) { "/pacticipants/Foo/versions/1234/tags/foo" }
  let(:headers) { { "CONTENT_TYPE" => "application/json" } }
  let(:response_body) { JSON.parse(subject.body, symbolize_names: true)}

  subject { put(path, {}, headers) }

  it "returns a 201 response" do
    expect(subject.status).to be 201
  end

  it "returns a HAL JSON Content Type" do
    expect(subject.headers["Content-Type"]).to eq "application/hal+json;charset=utf-8"
  end

  it "returns the newly created tag" do
    expect(response_body).to include name: "foo"
  end

  context "when the tag already exists" do
    before do
      td.subtract_day
        .create_consumer("Foo")
        .create_consumer_version("1234")
        .create_consumer_version_tag("foo")
    end

    it "returns a 200 response" do
      expect(subject.status).to be 200
    end
  end

  context "when there is an envionment with a matching name" do
    before do
      td.create_environment("foo")
    end

    it "creates a deployed version" do
      expect { subject }.to change { PactBroker::Deployments::DeployedVersion.where(auto_created: true).count }.by(1)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pact_broker-2.89.1 spec/features/create_tag_spec.rb
pact_broker-2.89.0 spec/features/create_tag_spec.rb
pact_broker-2.88.0 spec/features/create_tag_spec.rb
pact_broker-2.87.0 spec/features/create_tag_spec.rb
pact_broker-2.86.0 spec/features/create_tag_spec.rb
pact_broker-2.85.1 spec/features/create_tag_spec.rb
pact_broker-2.85.0 spec/features/create_tag_spec.rb
pact_broker-2.84.0 spec/features/create_tag_spec.rb