diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-07-26 09:27:07 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-07-26 09:27:07 +0000 |
commit | b68fd4c04bed4d8c9f7d0ad9d65125c36635c819 (patch) | |
tree | 17b09d2a189188957923a2b149287f1c44dcfd62 /test | |
parent | 6ddea3396b6b477591efc2372c2f5bceb9154e5a (diff) | |
download | redmine-b68fd4c04bed4d8c9f7d0ad9d65125c36635c819.tar.gz redmine-b68fd4c04bed4d8c9f7d0ad9d65125c36635c819.zip |
When moving an issue to another project, reassign it to the category with same name if any (#1653).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1697 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/fixtures/issue_categories.yml | 5 | ||||
-rw-r--r-- | test/unit/issue_test.rb | 15 |
2 files changed, 17 insertions, 3 deletions
diff --git a/test/fixtures/issue_categories.yml b/test/fixtures/issue_categories.yml index 2b74b5977..aa2f70351 100644 --- a/test/fixtures/issue_categories.yml +++ b/test/fixtures/issue_categories.yml @@ -14,4 +14,9 @@ issue_categories_003: project_id: 2
assigned_to_id:
id: 3
+issue_categories_004:
+ name: Printing
+ project_id: 2
+ assigned_to_id:
+ id: 4
\ No newline at end of file diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb index 0d98f89d2..12b4da336 100644 --- a/test/unit/issue_test.rb +++ b/test/unit/issue_test.rb @@ -165,17 +165,26 @@ class IssueTest < Test::Unit::TestCase assert !issue1.reload.closed? end - def test_move_to_another_project + def test_move_to_another_project_with_same_category 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 + # Category changes + assert_equal 4, issue.category_id # Make sure time entries were move to the target project assert_equal 2, issue.time_entries.first.project_id end + def test_move_to_another_project_without_same_category + issue = Issue.find(2) + assert issue.move_to(Project.find(2)) + issue.reload + assert_equal 2, issue.project_id + # Category cleared + assert_nil issue.category_id + end + def test_issue_destroy Issue.find(1).destroy assert_nil Issue.find_by_id(1) |