Sha256: 4bbfe9f193511410d14d95c2228476fa81f3127e7cb0dfb4083c7484acdca06f

Contents?: true

Size: 833 Bytes

Versions: 6

Compression:

Stored size: 833 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.new(: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

6 entries across 6 versions & 1 rubygems

Version Path
dm-ldap-adapter-0.3.5 spec/authentication_ldap_adapter_spec.rb
dm-ldap-adapter-0.3.4 spec/authentication_ldap_adapter_spec.rb
dm-ldap-adapter-0.3.1 spec/authentication_ldap_adapter_spec.rb
dm-ldap-adapter-0.3.2 spec/authentication_ldap_adapter_spec.rb
dm-ldap-adapter-0.3.3 spec/authentication_ldap_adapter_spec.rb
dm-ldap-adapter-0.3.0 spec/authentication_ldap_adapter_spec.rb