summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-07-10 23:14:16 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-07-10 23:14:16 +0000
commitfe07aee27efd5eca37533f67964158192025a0f4 (patch)
tree30f7c0e29c32917cf50a1d9071809466dc6e7dda
parentdb44c22d04cc98bdd1800e2c83c8373fd3b8efc2 (diff)
downloadredmine-fe07aee27efd5eca37533f67964158192025a0f4.tar.gz
redmine-fe07aee27efd5eca37533f67964158192025a0f4.zip
scm: filesystem: add functional test of destroying invalid repository (#6713, #4725).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6239 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--test/functional/repositories_filesystem_controller_test.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/functional/repositories_filesystem_controller_test.rb b/test/functional/repositories_filesystem_controller_test.rb
index a186e34e7..d40948644 100644
--- a/test/functional/repositories_filesystem_controller_test.rb
+++ b/test/functional/repositories_filesystem_controller_test.rb
@@ -125,6 +125,27 @@ class RepositoriesFilesystemControllerTest < ActionController::TestCase
@project.reload
assert_nil @project.repository
end
+
+ def test_destroy_invalid_repository
+ @request.session[:user_id] = 1 # admin
+
+ get :destroy, :id => PRJ_ID
+ assert_response 302
+ @project.reload
+ assert_nil @project.repository
+
+ @repository = Repository::Filesystem.create(
+ :project => Project.find(PRJ_ID),
+ :url => "/invalid",
+ :path_encoding => ''
+ )
+ assert @repository
+
+ get :destroy, :id => PRJ_ID
+ assert_response 302
+ @project.reload
+ assert_nil @project.repository
+ end
else
puts "Filesystem test repository NOT FOUND. Skipping functional tests !!!"
def test_fake; assert true end