summaryrefslogtreecommitdiffstats
path: root/test/unit/repository_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/repository_test.rb')
-rw-r--r--test/unit/repository_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/unit/repository_test.rb b/test/unit/repository_test.rb
index 03d836ef7..9ea9fdd45 100644
--- a/test/unit/repository_test.rb
+++ b/test/unit/repository_test.rb
@@ -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']