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

Version Path
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/mongo-2.8.0/spec/mongo/operation/indexes_spec.rb
mongo-2.11.6 spec/mongo/operation/indexes_spec.rb
mongo-2.10.5 spec/mongo/operation/indexes_spec.rb
mongo-2.11.5 spec/mongo/operation/indexes_spec.rb
mongo-2.11.4 spec/mongo/operation/indexes_spec.rb
mongo-2.10.4 spec/mongo/operation/indexes_spec.rb
mongo-2.11.3 spec/mongo/operation/indexes_spec.rb
mongo-2.11.2 spec/mongo/operation/indexes_spec.rb
mongo-2.11.1 spec/mongo/operation/indexes_spec.rb
mongo-2.10.3 spec/mongo/operation/indexes_spec.rb
mongo-2.11.0 spec/mongo/operation/indexes_spec.rb
mongo-2.9.2 spec/mongo/operation/indexes_spec.rb
mongo-2.10.2 spec/mongo/operation/indexes_spec.rb
mongo-2.11.0.rc0 spec/mongo/operation/indexes_spec.rb
mongo-2.10.1 spec/mongo/operation/indexes_spec.rb
mongo-2.10.0 spec/mongo/operation/indexes_spec.rb
mongo-2.9.1 spec/mongo/operation/indexes_spec.rb
mongo-2.10.0.rc0 spec/mongo/operation/indexes_spec.rb
mongo-2.9.1.rc0 spec/mongo/operation/indexes_spec.rb
mongo-2.9.0 spec/mongo/operation/indexes_spec.rb