debian-mirror-gitlab/spec/migrations/20220505174658_update_index_on_alerts_to_exclude_null_fingerprints_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
813 B
Ruby
Raw Normal View History

2022-07-16 23:28:13 +05:30
# frozen_string_literal: true
require 'spec_helper'
require_migration!
2023-03-04 22:38:38 +05:30
RSpec.describe UpdateIndexOnAlertsToExcludeNullFingerprints, feature_category: :incident_management do
2022-08-27 11:52:29 +05:30
let(:alerts) { 'alert_management_alerts' }
2022-07-16 23:28:13 +05:30
let(:old_index) { described_class::OLD_INDEX_NAME }
let(:new_index) { described_class::NEW_INDEX_NAME }
it 'correctly migrates up and down' do
reversible_migration do |migration|
migration.before -> {
expect(subject.index_exists_by_name?(alerts, old_index)).to be_truthy
expect(subject.index_exists_by_name?(alerts, new_index)).to be_falsey
}
migration.after -> {
expect(subject.index_exists_by_name?(alerts, old_index)).to be_falsey
expect(subject.index_exists_by_name?(alerts, new_index)).to be_truthy
}
end
end
end