diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-02-17 10:14:58 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-02-17 10:14:58 +0000 |
commit | b4013dc9f2c028637d6311df9a9db0302350f848 (patch) | |
tree | 00afb6601e22b5fd618c719dd4efbc3d1afe58b4 /test/unit/issue_test.rb | |
parent | c0a57964433e4045d3c6b1a15b7db007c40cbb37 (diff) | |
download | redmine-b4013dc9f2c028637d6311df9a9db0302350f848.tar.gz redmine-b4013dc9f2c028637d6311df9a9db0302350f848.zip |
Removed the default 0 value for issues foreign keys.
It prevents useless "... where id=0" queries and ensures that *_id attributes default to nil.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11417 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_test.rb')
-rw-r--r-- | test/unit/issue_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb index 8e3f8bfba..8f77140d3 100644 --- a/test/unit/issue_test.rb +++ b/test/unit/issue_test.rb @@ -35,6 +35,19 @@ class IssueTest < ActiveSupport::TestCase User.current = nil end + def test_initialize + issue = Issue.new + + assert_nil issue.project_id + assert_nil issue.tracker_id + assert_nil issue.author_id + assert_nil issue.assigned_to_id + assert_nil issue.category_id + + assert_equal IssueStatus.default, issue.status + assert_equal IssuePriority.default, issue.priority + end + def test_create issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 3, :status_id => 1, :priority => IssuePriority.all.first, |