Sha256: 3b659a5fe69143886a08c74deb1e3447d0afd0b7d10a711282869a081cd047cc

Contents?: true

Size: 855 Bytes

Versions: 18

Compression:

Stored size: 855 Bytes

Contents

# frozen_string_literal: true
# encoding: utf-8

require 'spec_helper'

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

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

  let(:conversation) do
    described_class.new(user, double('connection'))
  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

18 entries across 18 versions & 1 rubygems

Version Path
mongo-2.16.4 spec/mongo/auth/ldap/conversation_spec.rb
mongo-2.17.4 spec/mongo/auth/ldap/conversation_spec.rb
mongo-2.18.3 spec/mongo/auth/ldap/conversation_spec.rb
mongo-2.18.2 spec/mongo/auth/ldap/conversation_spec.rb
mongo-2.17.3 spec/mongo/auth/ldap/conversation_spec.rb
mongo-2.18.1 spec/mongo/auth/ldap/conversation_spec.rb
mongo-2.18.0 spec/mongo/auth/ldap/conversation_spec.rb
mongo-2.17.2 spec/mongo/auth/ldap/conversation_spec.rb
mongo-2.16.3 spec/mongo/auth/ldap/conversation_spec.rb
mongo-2.18.0.beta1 spec/mongo/auth/ldap/conversation_spec.rb
mongo-2.16.2 spec/mongo/auth/ldap/conversation_spec.rb
mongo-2.17.1 spec/mongo/auth/ldap/conversation_spec.rb
mongo-2.16.1 spec/mongo/auth/ldap/conversation_spec.rb
mongo-2.17.0 spec/mongo/auth/ldap/conversation_spec.rb
mongo-2.16.0 spec/mongo/auth/ldap/conversation_spec.rb
mongo-2.15.1 spec/mongo/auth/ldap/conversation_spec.rb
mongo-2.16.0.alpha1 spec/mongo/auth/ldap/conversation_spec.rb
mongo-2.15.0 spec/mongo/auth/ldap/conversation_spec.rb