debian-mirror-gitlab/spec/migrations/remove_hipchat_service_records_spec.rb

24 lines
539 B
Ruby
Raw Normal View History

2021-06-08 01:23:25 +05:30
# frozen_string_literal: true
require 'spec_helper'
2021-09-04 01:27:46 +05:30
require_migration!
2021-06-08 01:23:25 +05:30
RSpec.describe RemoveHipchatServiceRecords do
let(:services) { table(:services) }
before do
services.create!(type: 'HipchatService')
services.create!(type: 'SomeOtherType')
end
it 'removes services records of type HipchatService' do
expect(services.count).to eq(2)
migrate!
expect(services.count).to eq(1)
expect(services.first.type).to eq('SomeOtherType')
expect(services.where(type: 'HipchatService')).to be_empty
end
end