Clear changesets and changes with raw sql when deleting a repository (#1627).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1666 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2008-07-13 21:55:13 +00:00
parent 0eba42423a
commit fc07ba2a99
2 changed files with 20 additions and 1 deletions
+10
View File
@@ -45,6 +45,16 @@ class RepositoryTest < Test::Unit::TestCase
assert_equal repository, project.repository
end
def test_destroy
changesets = Changeset.count(:all, :conditions => "repository_id = 10")
changes = Change.count(:all, :conditions => "repository_id = 10", :include => :changeset)
assert_difference 'Changeset.count', -changesets do
assert_difference 'Change.count', -changes do
Repository.find(10).destroy
end
end
end
def test_should_not_create_with_disabled_scm
# disable Subversion
Setting.enabled_scm = ['Darcs', 'Git']