summaryrefslogtreecommitdiffstats
path: root/test/extra
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-29 08:53:41 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-29 08:53:41 +0000
commit427a745184d1b1b38ac045f6e86295e3e2b1e60a (patch)
treeaf1b43510aa8b1533650533f9a4754b7d9182b11 /test/extra
parent34c5b51cf095ddff2f38c44920ecdf428a6fb0b8 (diff)
downloadredmine-427a745184d1b1b38ac045f6e86295e3e2b1e60a.tar.gz
redmine-427a745184d1b1b38ac045f6e86295e3e2b1e60a.zip
Check that repository module is enabled (#24307).
git-svn-id: http://svn.redmine.org/redmine/trunk@16286 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/extra')
-rw-r--r--test/extra/redmine_pm/repository_subversion_test_pm.rb25
1 files changed, 24 insertions, 1 deletions
diff --git a/test/extra/redmine_pm/repository_subversion_test_pm.rb b/test/extra/redmine_pm/repository_subversion_test_pm.rb
index e031bba19..336619cf6 100644
--- a/test/extra/redmine_pm/repository_subversion_test_pm.rb
+++ b/test/extra/redmine_pm/repository_subversion_test_pm.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, :auth_sources
+ fixtures :projects, :users, :members, :roles, :member_roles, :auth_sources, :enabled_modules
SVN_BIN = Redmine::Configuration['scm_subversion_command'] || "svn"
@@ -38,6 +38,11 @@ class RedminePmTest::RepositorySubversionTest < RedminePmTest::TestCase
assert_failure "ls", svn_url
end
+ def test_anonymous_read_on_public_project_with_module_disabled_should_fail
+ Project.find(1).disable_module! :repository
+ assert_failure "ls", svn_url
+ end
+
def test_anonymous_read_on_private_repo_should_fail
Project.find(1).update_attribute :is_public, false
assert_failure "ls", svn_url
@@ -128,6 +133,15 @@ class RedminePmTest::RepositorySubversionTest < RedminePmTest::TestCase
end
end
+ def test_member_read_on_private_repo_with_module_disabled_should_fail
+ Role.find(2).add_permission! :browse_repository
+ Project.find(1).update_attribute :is_public, false
+ Project.find(1).disable_module! :repository
+ with_credentials "dlopper", "foo" do
+ assert_failure "ls", svn_url
+ end
+ end
+
def test_member_commit_on_public_repo_with_permission_should_succeed
Role.find(2).add_permission! :commit_access
with_credentials "dlopper", "foo" do
@@ -158,6 +172,15 @@ class RedminePmTest::RepositorySubversionTest < RedminePmTest::TestCase
end
end
+ def test_member_commit_on_private_repo_with_module_disabled_should_fail
+ Role.find(2).add_permission! :commit_access
+ Project.find(1).update_attribute :is_public, false
+ Project.find(1).disable_module! :repository
+ with_credentials "dlopper", "foo" do
+ assert_failure "mkdir --message Creating_a_directory", svn_url(random_filename)
+ end
+ end
+
def test_invalid_credentials_should_fail
Project.find(1).update_attribute :is_public, false
with_credentials "dlopper", "foo" do