summaryrefslogtreecommitdiffstats
path: root/test/unit/issue_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-11-29 19:46:40 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-11-29 19:46:40 +0000
commit88fcf484d4d3c8d591cc31d7d07790110161d923 (patch)
treee34f2c0054384cf22c1527cdf9c3e1771ad1b2bf /test/unit/issue_test.rb
parent3d317a435bb435b2ec8d2c6bc6ef3791dfcc080b (diff)
downloadredmine-88fcf484d4d3c8d591cc31d7d07790110161d923.tar.gz
redmine-88fcf484d4d3c8d591cc31d7d07790110161d923.zip
Enable tracker update on issue edit form (#2405).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3108 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_test.rb')
-rw-r--r--test/unit/issue_test.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb
index 3b0dd2697..afde6c720 100644
--- a/test/unit/issue_test.rb
+++ b/test/unit/issue_test.rb
@@ -164,6 +164,29 @@ class IssueTest < ActiveSupport::TestCase
assert_equal custom_value.id, issue.custom_value_for(field).id
end
+ def test_should_update_issue_with_disabled_tracker
+ p = Project.find(1)
+ issue = Issue.find(1)
+
+ p.trackers.delete(issue.tracker)
+ assert !p.trackers.include?(issue.tracker)
+
+ issue.reload
+ issue.subject = 'New subject'
+ assert issue.save
+ end
+
+ def test_should_not_set_a_disabled_tracker
+ p = Project.find(1)
+ p.trackers.delete(Tracker.find(2))
+
+ issue = Issue.find(1)
+ issue.tracker_id = 2
+ issue.subject = 'New subject'
+ assert !issue.save
+ assert_not_nil issue.errors.on(:tracker_id)
+ end
+
def test_category_based_assignment
issue = Issue.create(:project_id => 1, :tracker_id => 1, :author_id => 3, :status_id => 1, :priority => IssuePriority.all.first, :subject => 'Assignment test', :description => 'Assignment test', :category_id => 1)
assert_equal IssueCategory.find(1).assigned_to, issue.assigned_to