diff options
author | Go MAEDA <maeda@farend.jp> | 2020-01-21 04:08:29 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2020-01-21 04:08:29 +0000 |
commit | 006b686499a469fcafbf34bd910332f246c75b48 (patch) | |
tree | f84517e8e169e31b0c8a0663625afdf0accc05d8 /test/unit/issue_priority_test.rb | |
parent | 758a08fad9c9da5a8378bcde2cd29608b6127741 (diff) | |
download | redmine-006b686499a469fcafbf34bd910332f246c75b48.tar.gz redmine-006b686499a469fcafbf34bd910332f246c75b48.zip |
Extract finding the default or "middle" issue priority into its own class method (#32628).
Patch by Jan Schulz-Hofen.
git-svn-id: http://svn.redmine.org/redmine/trunk@19447 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_priority_test.rb')
-rw-r--r-- | test/unit/issue_priority_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/unit/issue_priority_test.rb b/test/unit/issue_priority_test.rb index 07cd5c6cf..2fb863ace 100644 --- a/test/unit/issue_priority_test.rb +++ b/test/unit/issue_priority_test.rb @@ -39,6 +39,15 @@ class IssuePriorityTest < ActiveSupport::TestCase assert_nil IssuePriority.default end + def test_default_or_middle_should_return_the_default_priority + assert_equal Enumeration.find_by_name('Normal'), IssuePriority.default_or_middle + end + + def test_default_or_middle_should_return_middle_when_no_default_priority + IssuePriority.update_all :is_default => false + assert_equal Enumeration.find_by_name('High'), IssuePriority.default_or_middle + end + def test_should_be_an_enumeration assert IssuePriority.ancestors.include?(Enumeration) end |