Sha256: 47b539f6448dd24d1a325ba98e8d8606dddfd03fd48cfd8efb9ae4b8a4bf3ca8

Contents?: true

Size: 641 Bytes

Versions: 2

Compression:

Stored size: 641 Bytes

Contents

RSpec.describe LolDba::IndexFinder do
  describe '.run' do
    before do
      allow(described_class).to receive(:check_for_indexes).and_return(missing_indexes)
      allow_any_instance_of(LolDba::MigrationFormatter).to receive(:puts_migration_content)
    end

    context 'with missing indexes' do
      let(:missing_indexes) { { friends: [%i[user_id friend_id]] } }

      it 'returns false' do
        expect(described_class.run).to eq true
      end
    end

    context 'with missing indexes' do
      let(:missing_indexes) { {} }

      it 'returns true' do
        expect(described_class.run).to eq false
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lol_dba-2.4.0 spec/index_finder_spec.rb
lol_dba-2.2.0 spec/index_finder_spec.rb