Sha256: db3c3f922b3aa6136388bacb6cd4ce62305d518d021e24127ad6ba0864f08a3a

Contents?: true

Size: 836 Bytes

Versions: 1

Compression:

Stored size: 836 Bytes

Contents

$LOAD_PATH << File.dirname(__FILE__)
require 'spec_helper'

describe DataMapper.repository(:ldap).adapter do

  describe 'user authentication' do

    before do
      DataMapper.repository(:ldap) do
        @user = User.create(:login => "beige", :name => 'Beige')
        @user.password = "asd123"
        @user.save
      end
    end

    after do
      DataMapper.repository(:ldap) do
        @user.destroy
      end
    end

    it 'should successfully authenticate' do
      DataMapper.repository(:ldap) do
        @user.authenticate("asd123").should be_true
        @user.password = "asd"
        @user.save
        @user.authenticate("asd").should be_true
      end
    end

    it 'should not authenticate' do
      DataMapper.repository(:ldap) do
        @user.authenticate("asdasd").should be_false
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dm-ldap-adapter-0.2.0 spec/authentication_ldap_adapter_spec.rb