]> source.dussan.org Git - redmine.git/commitdiff
Adds a test for changeset/issue relations deletion.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 11 Feb 2012 14:19:16 +0000 (14:19 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 11 Feb 2012 14:19:16 +0000 (14:19 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8848 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/repository_test.rb

index b3222591effefac1ffa47e72e2db9e028e5ee696..51a5c229d5a624ad616320aa29b5e9cb16680219 100644 (file)
@@ -83,6 +83,15 @@ class RepositoryTest < ActiveSupport::TestCase
     end
   end
 
+  def test_destroy_should_delete_issues_associations
+    changeset = Changeset.find(102)
+    changeset.issues = Issue.find_all_by_id([1, 2])
+
+    assert_difference 'Changeset.connection.select_all("select * from changesets_issues").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