summaryrefslogtreecommitdiffstats
path: root/test/unit/project_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/project_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/project_test.rb')
-rw-r--r--test/unit/project_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb
index 88e99c439..945f775e8 100644
--- a/test/unit/project_test.rb
+++ b/test/unit/project_test.rb
@@ -263,6 +263,15 @@ class ProjectTest < ActiveSupport::TestCase
assert_equal 0, CustomValue.where(:customized_type => ['Project', 'Issue', 'TimeEntry', 'Version']).count
end
+ def test_destroy_should_delete_time_entries_custom_values
+ project = Project.generate!
+ time_entry = TimeEntry.generate!(:project => project, :custom_field_values => {10 => '1'})
+
+ assert_difference 'CustomValue.where(:customized_type => "TimeEntry").count', -1 do
+ assert project.destroy
+ end
+ end
+
def test_move_an_orphan_project_to_a_root_project
sub = Project.find(2)
sub.set_parent! @ecookbook