summaryrefslogtreecommitdiffstats
path: root/test/unit/issue_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-12-18 18:39:09 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-12-18 18:39:09 +0000
commit5c5ba0c61af44bdbd8931c131192963179cca9ac (patch)
treed950222bd2a006e1b1ce1d14b31e607f95240d6e /test/unit/issue_test.rb
parentd4297ca3ff309a63737e2d12adb4ea1ec0085828 (diff)
downloadredmine-5c5ba0c61af44bdbd8931c131192963179cca9ac.tar.gz
redmine-5c5ba0c61af44bdbd8931c131192963179cca9ac.zip
Fixed that time entries custom values are not deleted when deleting a project or an issue (#15709).
git-svn-id: http://svn.redmine.org/redmine/trunk@12421 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_test.rb')
-rw-r--r--test/unit/issue_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb
index 4e82aa007..0e252cc2e 100644
--- a/test/unit/issue_test.rb
+++ b/test/unit/issue_test.rb
@@ -1375,6 +1375,15 @@ class IssueTest < ActiveSupport::TestCase
assert_nil TimeEntry.find_by_issue_id(1)
end
+ def test_destroy_should_delete_time_entries_custom_values
+ issue = Issue.generate!
+ time_entry = TimeEntry.generate!(:issue => issue, :custom_field_values => {10 => '1'})
+
+ assert_difference 'CustomValue.where(:customized_type => "TimeEntry").count', -1 do
+ assert issue.destroy
+ end
+ end
+
def test_destroying_a_deleted_issue_should_not_raise_an_error
issue = Issue.find(1)
Issue.find(1).destroy