Adds a test for changeset/issue relations deletion.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8848 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-02-11 14:19:16 +00:00
parent 8f92121606
commit b5fabd052b
1 changed files with 9 additions and 0 deletions

View 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