summaryrefslogtreecommitdiffstats
path: root/test/unit/issue_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-11-17 17:45:21 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-11-17 17:45:21 +0000
commite2c606e974593c04d8544d3319453bdfda7982d8 (patch)
tree26ec97acddcc05cf7060ed336c07865e75a879f4 /test/unit/issue_test.rb
parent9ad79612fed43e70f318aed2f90d8b29ad667a77 (diff)
downloadredmine-e2c606e974593c04d8544d3319453bdfda7982d8.tar.gz
redmine-e2c606e974593c04d8544d3319453bdfda7982d8.zip
Fixed: Update of time entry fails when the issue has been moved to an other project.
Fixed: Error when moving an issue without changing its tracker (Postgresql). git-svn-id: http://redmine.rubyforge.org/svn/trunk@909 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_test.rb')
-rw-r--r--test/unit/issue_test.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb
index 5ddd4bde4..6ffbe0a8b 100644
--- a/test/unit/issue_test.rb
+++ b/test/unit/issue_test.rb
@@ -18,7 +18,7 @@
require File.dirname(__FILE__) + '/../test_helper'
class IssueTest < Test::Unit::TestCase
- fixtures :projects, :users, :members, :trackers, :issue_statuses, :issue_categories, :enumerations, :issues, :custom_fields, :custom_values
+ fixtures :projects, :users, :members, :trackers, :issue_statuses, :issue_categories, :enumerations, :issues, :custom_fields, :custom_values, :time_entries
def test_category_based_assignment
issue = Issue.create(:project_id => 1, :tracker_id => 1, :author_id => 3, :status_id => 1, :priority => Enumeration.get_values('IPRI').first, :subject => 'Assignment test', :description => 'Assignment test', :category_id => 1)
@@ -59,4 +59,15 @@ class IssueTest < Test::Unit::TestCase
assert issue2.reload.closed?
assert issue3.reload.closed?
end
+
+ def test_move_to_another_project
+ issue = Issue.find(1)
+ assert issue.move_to(Project.find(2))
+ issue.reload
+ assert_equal 2, issue.project_id
+ # Category removed
+ assert_nil issue.category
+ # Make sure time entries were move to the target project
+ assert_equal 2, issue.time_entries.first.project_id
+ end
end