Moves the LDAP test server to a fixture.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3490 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
7ae53845ac
commit
899f06612a
|
@ -1,2 +1,13 @@
|
||||||
--- {}
|
---
|
||||||
|
auth_sources_001:
|
||||||
|
id: 1
|
||||||
|
type: AuthSourceLdap
|
||||||
|
name: 'LDAP test server'
|
||||||
|
host: '127.0.0.1'
|
||||||
|
port: 389
|
||||||
|
base_dn: 'OU=Person,DC=redmine,DC=org'
|
||||||
|
attr_login: uid
|
||||||
|
attr_firstname: givenName
|
||||||
|
attr_lastname: sn
|
||||||
|
attr_mail: mail
|
||||||
|
onthefly_register: true
|
||||||
|
|
|
@ -18,7 +18,8 @@
|
||||||
require File.dirname(__FILE__) + '/../test_helper'
|
require File.dirname(__FILE__) + '/../test_helper'
|
||||||
|
|
||||||
class AuthSourceLdapTest < ActiveSupport::TestCase
|
class AuthSourceLdapTest < ActiveSupport::TestCase
|
||||||
|
fixtures :auth_sources
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -37,16 +38,7 @@ class AuthSourceLdapTest < ActiveSupport::TestCase
|
||||||
if ldap_configured?
|
if ldap_configured?
|
||||||
context '#authenticate' do
|
context '#authenticate' do
|
||||||
setup do
|
setup do
|
||||||
@auth = AuthSourceLdap.generate!(:name => 'on the fly',
|
@auth = AuthSourceLdap.find(1)
|
||||||
:host => '127.0.0.1',
|
|
||||||
:port => 389,
|
|
||||||
:base_dn => 'OU=Person,DC=redmine,DC=org',
|
|
||||||
:attr_login => 'uid',
|
|
||||||
:attr_firstname => 'givenName',
|
|
||||||
:attr_lastname => 'sn',
|
|
||||||
:attr_mail => 'mail',
|
|
||||||
:onthefly_register => true)
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with a valid LDAP user' do
|
context 'with a valid LDAP user' do
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
require File.dirname(__FILE__) + '/../test_helper'
|
require File.dirname(__FILE__) + '/../test_helper'
|
||||||
|
|
||||||
class UserTest < ActiveSupport::TestCase
|
class UserTest < ActiveSupport::TestCase
|
||||||
fixtures :users, :members, :projects, :roles, :member_roles
|
fixtures :users, :members, :projects, :roles, :member_roles, :auth_sources
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@admin = User.find(1)
|
@admin = User.find(1)
|
||||||
|
@ -124,16 +124,7 @@ class UserTest < ActiveSupport::TestCase
|
||||||
context "#try_to_login using LDAP" do
|
context "#try_to_login using LDAP" do
|
||||||
context "on the fly registration" do
|
context "on the fly registration" do
|
||||||
setup do
|
setup do
|
||||||
@auth_source = AuthSourceLdap.generate!(:name => 'localhost',
|
@auth_source = AuthSourceLdap.find(1)
|
||||||
:host => '127.0.0.1',
|
|
||||||
:port => 389,
|
|
||||||
:base_dn => 'OU=Person,DC=redmine,DC=org',
|
|
||||||
:attr_login => 'uid',
|
|
||||||
:attr_firstname => 'givenName',
|
|
||||||
:attr_lastname => 'sn',
|
|
||||||
:attr_mail => 'mail',
|
|
||||||
:onthefly_register => true)
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context "with a successful authentication" do
|
context "with a successful authentication" do
|
||||||
|
|
Loading…
Reference in New Issue