Sha256: 17302d57c458e7649aa813de747aac929bd74f4d4c1eb3491048afb20cf9d6a2

Contents?: true

Size: 605 Bytes

Versions: 12

Compression:

Stored size: 605 Bytes

Contents

require 'spec_helper'

describe Mongo::Operation::Commands::Indexes do

  describe '#execute' do

    let(:spec) do
      { name: 1 }
    end

    before do
      authorized_collection.indexes.create_one(spec, unique: true)
    end

    after do
      authorized_collection.indexes.drop_one('name_1')
    end

    let(:operation) do
      described_class.new(db_name: TEST_DB, coll_name: TEST_COLL)
    end

    let(:indexes) do
      operation.execute(authorized_primary.context)
    end

    it 'returns the indexes for the collection' do
      expect(indexes.documents.size).to eq(2)
    end
  end
end

Version data entries

12 entries across 11 versions & 3 rubygems

Version Path
mongo-2.2.7 spec/mongo/operation/commands/indexes_spec.rb
mongo-2.2.6 spec/mongo/operation/commands/indexes_spec.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/mongo-2.2.5/spec/mongo/operation/commands/indexes_spec.rb
mongo-2.2.5 spec/mongo/operation/commands/indexes_spec.rb
mongo-2.2.4 spec/mongo/operation/commands/indexes_spec.rb
mongo-2.2.3 spec/mongo/operation/commands/indexes_spec.rb
mongo-2.2.2 spec/mongo/operation/commands/indexes_spec.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/mongo-2.2.1/spec/mongo/operation/commands/indexes_spec.rb
tdiary-4.2.1 vendor/bundle/ruby/2.3.0/gems/mongo-2.2.1/spec/mongo/operation/commands/indexes_spec.rb
mongo-2.2.1 spec/mongo/operation/commands/indexes_spec.rb
mongo-2.2.0 spec/mongo/operation/commands/indexes_spec.rb
mongo-2.2.0.rc0 spec/mongo/operation/commands/indexes_spec.rb