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

base_validator_spec.rb « validators « schema_validation « database « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cf5207aee955797e6dca5ddda3d779f6046e431c (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
25
26
27
28
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Gitlab::Database::SchemaValidation::Validators::BaseValidator, feature_category: :database do
  describe '.all_validators' do
    subject(:all_validators) { described_class.all_validators }

    it 'returns an array of all validators' do
      expect(all_validators).to eq([
        Gitlab::Database::SchemaValidation::Validators::ExtraIndexes,
        Gitlab::Database::SchemaValidation::Validators::MissingIndexes,
        Gitlab::Database::SchemaValidation::Validators::DifferentDefinitionIndexes
      ])
    end
  end

  describe '#execute' do
    let(:structure_sql) { instance_double(Gitlab::Database::SchemaValidation::StructureSql) }
    let(:database) { instance_double(Gitlab::Database::SchemaValidation::Database) }

    subject(:inconsistencies) { described_class.new(structure_sql, database).execute }

    it 'raises an exception' do
      expect { inconsistencies }.to raise_error(NoMethodError)
    end
  end
end