Sha256: fe77b9a3d51baa67e2ccd202e3ef847f9d22a1709f38c3f2a35248d0c007ab2e

Contents?: true

Size: 795 Bytes

Versions: 10

Compression:

Stored size: 795 Bytes

Contents

require 'spec_helper'

describe Mongo::Auth::LDAP::Conversation do

  let(:user) do
    Mongo::Auth::User.new(
      database: Mongo::Database::ADMIN,
      user: 'user',
      password: 'pencil'
    )
  end

  let(:conversation) do
    described_class.new(user)
  end

  describe '#start' do

    let(:query) do
      conversation.start(nil)
    end

    let(:selector) do
      query.selector
    end

    it 'sets the sasl start flag' do
      expect(selector[:saslStart]).to eq(1)
    end

    it 'sets the auto authorize flag' do
      expect(selector[:autoAuthorize]).to eq(1)
    end

    it 'sets the mechanism' do
      expect(selector[:mechanism]).to eq('PLAIN')
    end

    it 'sets the payload' do
      expect(selector[:payload].data).to eq("\x00user\x00pencil")
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
mongo-2.12.4 spec/mongo/auth/ldap/conversation_spec.rb
mongo-2.11.6 spec/mongo/auth/ldap/conversation_spec.rb
mongo-2.12.3 spec/mongo/auth/ldap/conversation_spec.rb
mongo-2.12.2 spec/mongo/auth/ldap/conversation_spec.rb
mongo-2.11.5 spec/mongo/auth/ldap/conversation_spec.rb
mongo-2.12.1 spec/mongo/auth/ldap/conversation_spec.rb
mongo-2.12.0.rc0 spec/mongo/auth/ldap/conversation_spec.rb
mongo-2.11.4 spec/mongo/auth/ldap/conversation_spec.rb
mongo-2.11.3 spec/mongo/auth/ldap/conversation_spec.rb
mongo-2.11.2 spec/mongo/auth/ldap/conversation_spec.rb