Add a password to fixture's ldap_user. It's unused by the LDAP test, but it was causing some databases to have issues.

Also, because the ldap test requires external integration, it now does not run by default. To make it run set the RUN_TRACKS_LDAP_TESTS environment variable, for example:

  env RUN_TRACKS_LDAP_TESTS=true rake test:integration



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@344 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
lukemelia 2006-11-15 14:43:12 +00:00
parent c51587e422
commit 04bd157857
2 changed files with 13 additions and 4 deletions

View file

@ -22,7 +22,7 @@ other_user:
ldap_user:
id: 3
login: john
password:
password: test
word: <%= Digest::SHA1.hexdigest("johnSun Feb 19 14:42:45 GMT 20060.408173979260027") %>
is_admin: false
first_name: John

View file

@ -17,6 +17,7 @@ class LdapAuthTest < Test::Unit::TestCase
fixtures :users
RUN_LDAP_TESTS = ENV['RUN_TRACKS_LDAP_TESTS'] || false
SLAPD_BIN = "/usr/libexec/slapd" #You may need to adjust this
SLAPD_SCHEMA_DIR = "/etc/openldap/schema/" #You may need to adjust this
SLAPD_TEST_PORT = 10389
@ -35,12 +36,18 @@ class LdapAuthTest < Test::Unit::TestCase
assert_equal "test", ENV['RAILS_ENV']
assert_equal "change-me", Tracks::Config.salt
setup_ldap_server_conf
start_ldap_server
if RUN_LDAP_TESTS
setup_ldap_server_conf
start_ldap_server
end
end
def teardown
stop_ldap_server
stop_ldap_server if RUN_LDAP_TESTS
end
def test_truth
assert true
end
def test_authenticate_against_ldap
@ -50,6 +57,8 @@ class LdapAuthTest < Test::Unit::TestCase
assert_not_nil(user)
assert_equal user.login, 'john'
end
private :test_authenticate_against_ldap unless RUN_LDAP_TESTS
def setup_ldap_server_conf
@slapd_conf = create_slapd_conf()