summaryrefslogtreecommitdiffstats
path: root/test/unit/repository_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-11 14:17:47 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-11 14:17:47 +0000
commit8f921216067c023282c1f490b27f07543f096489 (patch)
treea2e9830731bfcf741981027e56502d9fed1a3751 /test/unit/repository_test.rb
parent17d5118de68f143e570790c5248347ab9e131b02 (diff)
downloadredmine-8f921216067c023282c1f490b27f07543f096489.tar.gz
redmine-8f921216067c023282c1f490b27f07543f096489.zip
Fixed that changesets parents associations are not deleted when deleting a repository.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8847 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/repository_test.rb')
-rw-r--r--test/unit/repository_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/unit/repository_test.rb b/test/unit/repository_test.rb
index 275dc8bee..b3222591e 100644
--- a/test/unit/repository_test.rb
+++ b/test/unit/repository_test.rb
@@ -74,6 +74,15 @@ class RepositoryTest < ActiveSupport::TestCase
end
end
+ def test_destroy_should_delete_parents_associations
+ changeset = Changeset.find(102)
+ changeset.parents = Changeset.find_all_by_id([100, 101])
+
+ assert_difference 'Changeset.connection.select_all("select * from changeset_parents").size', -2 do
+ Repository.find(10).destroy
+ end
+ end
+
def test_should_not_create_with_disabled_scm
# disable Subversion
with_settings :enabled_scm => ['Darcs', 'Git'] do