summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-07-10 15:48:21 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-07-10 15:48:21 +0000
commit7c505aaff3043b9c5526b698f0c25dcc8f31b5ec (patch)
treeddc4c8b3ce53b2031d85ae9e6624af7ee99d190b
parent6ee6d709f26bb43edc982b4d096c114420dea742 (diff)
downloadredmine-7c505aaff3043b9c5526b698f0c25dcc8f31b5ec.tar.gz
redmine-7c505aaff3043b9c5526b698f0c25dcc8f31b5ec.zip
scm: subversion: add functional test of destroying invalid repository (#8458, #6713, #4725).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6225 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--test/functional/repositories_subversion_controller_test.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/functional/repositories_subversion_controller_test.rb b/test/functional/repositories_subversion_controller_test.rb
index 17c09cbf5..be4a21db4 100644
--- a/test/functional/repositories_subversion_controller_test.rb
+++ b/test/functional/repositories_subversion_controller_test.rb
@@ -308,6 +308,32 @@ class RepositoriesSubversionControllerTest < ActionController::TestCase
assert_nil @project.repository
end
+ def test_destroy_invalid_repository
+ @request.session[:user_id] = 1 # admin
+ @repository.fetch_changesets
+ @repository.reload
+ assert @repository.changesets.count > 0
+
+ get :destroy, :id => PRJ_ID
+ assert_response 302
+
+ @project.reload
+ assert_nil @project.repository
+
+ @repository = Repository::Subversion.create(:project => @project,
+ :url => "file:///invalid")
+ assert @repository
+ @repository.fetch_changesets
+ @repository.reload
+ assert_equal 0, @repository.changesets.count
+
+ get :destroy, :id => PRJ_ID
+ assert_response 302
+
+ @project.reload
+ assert_nil @project.repository
+ end
+
else
puts "Subversion test repository NOT FOUND. Skipping functional tests !!!"
def test_fake; assert true end