##// END OF EJS Templates
Moves the LDAP test server to a fixture....
Jean-Philippe Lang -
r3376:899f06612a47
parent child
Show More
@@ -1,2 +1,13
1 --- {}
1 ---
2
2 auth_sources_001:
3 id: 1
4 type: AuthSourceLdap
5 name: 'LDAP test server'
6 host: '127.0.0.1'
7 port: 389
8 base_dn: 'OU=Person,DC=redmine,DC=org'
9 attr_login: uid
10 attr_firstname: givenName
11 attr_lastname: sn
12 attr_mail: mail
13 onthefly_register: true
@@ -18,7 +18,8
18 require File.dirname(__FILE__) + '/../test_helper'
18 require File.dirname(__FILE__) + '/../test_helper'
19
19
20 class AuthSourceLdapTest < ActiveSupport::TestCase
20 class AuthSourceLdapTest < ActiveSupport::TestCase
21
21 fixtures :auth_sources
22
22 def setup
23 def setup
23 end
24 end
24
25
@@ -37,16 +38,7 class AuthSourceLdapTest < ActiveSupport::TestCase
37 if ldap_configured?
38 if ldap_configured?
38 context '#authenticate' do
39 context '#authenticate' do
39 setup do
40 setup do
40 @auth = AuthSourceLdap.generate!(:name => 'on the fly',
41 @auth = AuthSourceLdap.find(1)
41 :host => '127.0.0.1',
42 :port => 389,
43 :base_dn => 'OU=Person,DC=redmine,DC=org',
44 :attr_login => 'uid',
45 :attr_firstname => 'givenName',
46 :attr_lastname => 'sn',
47 :attr_mail => 'mail',
48 :onthefly_register => true)
49
50 end
42 end
51
43
52 context 'with a valid LDAP user' do
44 context 'with a valid LDAP user' do
@@ -18,7 +18,7
18 require File.dirname(__FILE__) + '/../test_helper'
18 require File.dirname(__FILE__) + '/../test_helper'
19
19
20 class UserTest < ActiveSupport::TestCase
20 class UserTest < ActiveSupport::TestCase
21 fixtures :users, :members, :projects, :roles, :member_roles
21 fixtures :users, :members, :projects, :roles, :member_roles, :auth_sources
22
22
23 def setup
23 def setup
24 @admin = User.find(1)
24 @admin = User.find(1)
@@ -124,16 +124,7 class UserTest < ActiveSupport::TestCase
124 context "#try_to_login using LDAP" do
124 context "#try_to_login using LDAP" do
125 context "on the fly registration" do
125 context "on the fly registration" do
126 setup do
126 setup do
127 @auth_source = AuthSourceLdap.generate!(:name => 'localhost',
127 @auth_source = AuthSourceLdap.find(1)
128 :host => '127.0.0.1',
129 :port => 389,
130 :base_dn => 'OU=Person,DC=redmine,DC=org',
131 :attr_login => 'uid',
132 :attr_firstname => 'givenName',
133 :attr_lastname => 'sn',
134 :attr_mail => 'mail',
135 :onthefly_register => true)
136
137 end
128 end
138
129
139 context "with a successful authentication" do
130 context "with a successful authentication" do
General Comments 0
You need to be logged in to leave comments. Login now