From 04bd1578573c5a122cab9bd17cdd79c01f7b72c9 Mon Sep 17 00:00:00 2001 From: lukemelia Date: Wed, 15 Nov 2006 14:43:12 +0000 Subject: [PATCH] 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 --- tracks/test/fixtures/users.yml | 2 +- tracks/test/integration/ldap_auth_test.rb | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/tracks/test/fixtures/users.yml b/tracks/test/fixtures/users.yml index 1e9d1b2a..a29a961b 100644 --- a/tracks/test/fixtures/users.yml +++ b/tracks/test/fixtures/users.yml @@ -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 diff --git a/tracks/test/integration/ldap_auth_test.rb b/tracks/test/integration/ldap_auth_test.rb index 98493b1d..9c6e5709 100755 --- a/tracks/test/integration/ldap_auth_test.rb +++ b/tracks/test/integration/ldap_auth_test.rb @@ -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()