summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-06-14 08:04:44 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-06-14 08:04:44 +0000
commit9eef74f09aa7ff5540d63fbe77395bfedc57a4dc (patch)
tree35f5b0c197669526844c4567d247ef19a3452bc4 /test
parent48a557a79e156c7ea629b33637fe9d73f0ab4598 (diff)
downloadredmine-9eef74f09aa7ff5540d63fbe77395bfedc57a4dc.tar.gz
redmine-9eef74f09aa7ff5540d63fbe77395bfedc57a4dc.zip
Additional tests for Redmine.pm.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9828 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/extra/redmine_pm/repository_subversion_test.rb37
1 files changed, 36 insertions, 1 deletions
diff --git a/test/extra/redmine_pm/repository_subversion_test.rb b/test/extra/redmine_pm/repository_subversion_test.rb
index 3700d3fd9..2c3e8de26 100644
--- a/test/extra/redmine_pm/repository_subversion_test.rb
+++ b/test/extra/redmine_pm/repository_subversion_test.rb
@@ -19,7 +19,7 @@ require File.expand_path('../test_case', __FILE__)
require 'tmpdir'
class RedminePmTest::RepositorySubversionTest < RedminePmTest::TestCase
- fixtures :projects, :users, :members, :roles, :member_roles
+ fixtures :projects, :users, :members, :roles, :member_roles, :auth_sources
SVN_BIN = Redmine::Configuration['scm_subversion_command'] || "svn"
@@ -153,6 +153,41 @@ class RedminePmTest::RepositorySubversionTest < RedminePmTest::TestCase
end
end
+ def test_anonymous_read_should_fail_with_login_required
+ assert_success "ls", svn_url
+ with_settings :login_required => '1' do
+ assert_failure "ls", svn_url
+ end
+ end
+
+ def test_authenticated_read_should_succeed_with_login_required
+ with_settings :login_required => '1' do
+ with_credentials "miscuser8", "foo" do
+ assert_success "ls", svn_url
+ end
+ end
+ end
+
+ if ldap_configured?
+ def test_user_with_ldap_auth_source_should_authenticate_with_ldap_credentials
+ ldap_user = User.new(:mail => 'example1@redmine.org', :firstname => 'LDAP', :lastname => 'user', :auth_source_id => 1)
+ ldap_user.login = 'example1'
+ ldap_user.save!
+
+ with_settings :login_required => '1' do
+ with_credentials "example1", "123456" do
+ assert_success "ls", svn_url
+ end
+ end
+
+ with_settings :login_required => '1' do
+ with_credentials "example1", "wrong" do
+ assert_failure "ls", svn_url
+ end
+ end
+ end
+ end
+
def test_checkout
Dir.mktmpdir do |dir|
assert_success "checkout", svn_url, dir