Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20210603222333_remove_builds_email_service_from_services_spec.rb « migrations « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 14aa4fe8da705bd006754940a9bd3fee3ca753cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

require 'spec_helper'

require_migration!

RSpec.describe RemoveBuildsEmailServiceFromServices do
  let(:namespaces) { table(:namespaces) }
  let(:projects) { table(:projects) }
  let(:services) { table(:services) }
  let(:namespace) { namespaces.create!(name: 'foo', path: 'bar') }
  let(:project) { projects.create!(namespace_id: namespace.id) }

  it 'correctly deletes `BuildsEmailService` services' do
    services.create!(project_id: project.id, type: 'BuildsEmailService')
    services.create!(project_id: project.id, type: 'OtherService')

    expect(services.all.pluck(:type)).to match_array %w[BuildsEmailService OtherService]

    migrate!

    expect(services.all.pluck(:type)).to eq %w[OtherService]
  end
end