Sha256: 2c786fc7cc936a36c92fb2f39da38d50ddfb3f32f39cdeebd626fef3ef41ee65

Contents?: true

Size: 1.19 KB

Versions: 12

Compression:

Stored size: 1.19 KB

Contents

describe "migrate to pact versions (migrate 22-24)", migration: true do
  before do
    PactBroker::Database.migrate(22)
  end

  let(:now) { DateTime.new(2017, 1, 1) }
  let(:pact_updated_at) { DateTime.new(2017, 1, 2) }
  let!(:consumer) { create(:pacticipants, {name: "Consumer", created_at: now, updated_at: now}) }
  let!(:provider) { create(:pacticipants, {name: "Provider", created_at: now, updated_at: now}) }
  let!(:consumer_version) { create(:versions, {number: "1.2.3", order: 1, pacticipant_id: consumer[:id], created_at: now, updated_at: now}) }
  let!(:pact_version_content) { create(:pact_version_contents, {content: {some: "json"}.to_json, sha: "1234", created_at: now, updated_at: now}, :sha) }
  let!(:pact_1) { create(:pacts, {version_id: consumer_version[:id], provider_id: provider[:id], pact_version_content_sha: "1234", created_at: now, updated_at: pact_updated_at}) }

  let!(:pact_version_content_orphan) { create(:pact_version_contents, {content: {some: "json"}.to_json, sha: "4567", created_at: now, updated_at: now}, :sha) }

  subject { PactBroker::Database.migrate(34) }

  it "deletes orphan pact_versions" do
    subject
    expect(database[:pact_versions].count).to eq 1
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
pact_broker-2.89.1 spec/migrations/24_populate_pact_contents_spec.rb
pact_broker-2.89.0 spec/migrations/24_populate_pact_contents_spec.rb
pact_broker-2.88.0 spec/migrations/24_populate_pact_contents_spec.rb
pact_broker-2.87.0 spec/migrations/24_populate_pact_contents_spec.rb
pact_broker-2.86.0 spec/migrations/24_populate_pact_contents_spec.rb
pact_broker-2.85.1 spec/migrations/24_populate_pact_contents_spec.rb
pact_broker-2.85.0 spec/migrations/24_populate_pact_contents_spec.rb
pact_broker-2.84.0 spec/migrations/24_populate_pact_contents_spec.rb
pact_broker-2.83.0 spec/migrations/24_populate_pact_contents_spec.rb
pact_broker-2.82.0 spec/migrations/24_populate_pact_contents_spec.rb
pact_broker-2.81.0 spec/migrations/24_populate_pact_contents_spec.rb
pact_broker-2.80.0 spec/migrations/24_populate_pact_contents_spec.rb