Makes the test LDAP host configurable (#21674).

git-svn-id: http://svn.redmine.org/redmine/trunk@15088 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2016-01-22 18:10:26 +00:00
parent ceb476a7c5
commit 52621c697d
3 changed files with 5 additions and 27 deletions

View File

@@ -22,6 +22,8 @@ if ENV["COVERAGE"]
SimpleCov.start 'rails'
end
$redmine_test_ldap_server = ENV['REDMINE_TEST_LDAP_SERVER'] || '127.0.0.1'
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 'rails/test_help'
@@ -122,7 +124,7 @@ class ActiveSupport::TestCase
end
def self.ldap_configured?
@test_ldap = Net::LDAP.new(:host => '127.0.0.1', :port => 389)
@test_ldap = Net::LDAP.new(:host => $redmine_test_ldap_server, :port => 389)
return @test_ldap.bind
rescue Exception => e
# LDAP is not listening