Sha256: a094ff71d4553037cd11ecda516c887468913649414f414cafc3b31b60b8abc6
Contents?: true
Size: 797 Bytes
Versions: 28
Compression:
Stored size: 797 Bytes
Contents
require 'spec_helper' describe Mongo::Operation::Indexes do describe '#execute' do let(:index_spec) do { name: 1 } end before do authorized_collection.drop authorized_collection.insert_one(test: 1) authorized_collection.indexes.create_one(index_spec, unique: true) end after do authorized_collection.indexes.drop_one('name_1') end let(:operation) do described_class.new({ selector: { listIndexes: TEST_COLL }, coll_name: TEST_COLL, db_name: SpecConfig.instance.test_db }) end let(:indexes) do operation.execute(authorized_primary) end it 'returns the indexes for the collection' do expect(indexes.documents.size).to eq(2) end end end
Version data entries
28 entries across 28 versions & 2 rubygems