summaryrefslogtreecommitdiffstats
path: root/test/extra
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-06-25 20:08:49 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-06-25 20:08:49 +0000
commit21ac4a3d0e074b7ec4b3b7bc88ec28440b99ce15 (patch)
tree153b8b678461321d36e53d7b45ac2f46a9b780c0 /test/extra
parent2ceb6b8230a35be04b6f541e681abae8f034867e (diff)
downloadredmine-21ac4a3d0e074b7ec4b3b7bc88ec28440b99ce15.tar.gz
redmine-21ac4a3d0e074b7ec4b3b7bc88ec28440b99ce15.zip
Makes Redmine.pm handle project status (#3640).
Repositories of archived projects are no longer accessible. Repositories of closed projects are read-only. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9887 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/extra')
-rw-r--r--test/extra/redmine_pm/repository_subversion_test.rb43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/extra/redmine_pm/repository_subversion_test.rb b/test/extra/redmine_pm/repository_subversion_test.rb
index 2c3e8de26..7be3d3821 100644
--- a/test/extra/redmine_pm/repository_subversion_test.rb
+++ b/test/extra/redmine_pm/repository_subversion_test.rb
@@ -168,6 +168,49 @@ class RedminePmTest::RepositorySubversionTest < RedminePmTest::TestCase
end
end
+ def test_read_on_archived_projects_should_fail
+ Project.find(1).update_attribute :status, Project::STATUS_ARCHIVED
+ assert_failure "ls", svn_url
+ end
+
+ def test_read_on_archived_private_projects_should_fail
+ Project.find(1).update_attribute :status, Project::STATUS_ARCHIVED
+ Project.find(1).update_attribute :is_public, false
+ with_credentials "dlopper", "foo" do
+ assert_failure "ls", svn_url
+ end
+ end
+
+ def test_read_on_closed_projects_should_succeed
+ Project.find(1).update_attribute :status, Project::STATUS_CLOSED
+ assert_success "ls", svn_url
+ end
+
+ def test_read_on_closed_private_projects_should_succeed
+ Project.find(1).update_attribute :status, Project::STATUS_CLOSED
+ Project.find(1).update_attribute :is_public, false
+ with_credentials "dlopper", "foo" do
+ assert_success "ls", svn_url
+ end
+ end
+
+ def test_commit_on_closed_projects_should_fail
+ Project.find(1).update_attribute :status, Project::STATUS_CLOSED
+ Role.find(2).add_permission! :commit_access
+ with_credentials "dlopper", "foo" do
+ assert_failure "mkdir --message Creating_a_directory", svn_url(random_filename)
+ end
+ end
+
+ def test_commit_on_closed_private_projects_should_fail
+ Project.find(1).update_attribute :status, Project::STATUS_CLOSED
+ Project.find(1).update_attribute :is_public, false
+ Role.find(2).add_permission! :commit_access
+ with_credentials "dlopper", "foo" do
+ assert_failure "mkdir --message Creating_a_directory", svn_url(random_filename)
+ 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)