summaryrefslogtreecommitdiffstats
path: root/test/unit/issue_priority_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-05-25 19:48:22 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-05-25 19:48:22 +0000
commit221585c7b5708659e9059b6119846948b07570bb (patch)
treebb864aff3c998c6e74b922d5dd78297ee2b3e404 /test/unit/issue_priority_test.rb
parente7b9a9c6ff43711faf5ef0f1c480b43c61636f8c (diff)
downloadredmine-221585c7b5708659e9059b6119846948b07570bb.tar.gz
redmine-221585c7b5708659e9059b6119846948b07570bb.zip
Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9713 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_priority_test.rb')
-rw-r--r--test/unit/issue_priority_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unit/issue_priority_test.rb b/test/unit/issue_priority_test.rb
index 6faf46afa..349cc2e4b 100644
--- a/test/unit/issue_priority_test.rb
+++ b/test/unit/issue_priority_test.rb
@@ -20,6 +20,19 @@ require File.expand_path('../../test_helper', __FILE__)
class IssuePriorityTest < ActiveSupport::TestCase
fixtures :enumerations, :issues
+ def test_named_scope
+ assert_equal Enumeration.find_by_name('Normal'), Enumeration.named('normal').first
+ end
+
+ def test_default_should_return_the_default_priority
+ assert_equal Enumeration.find_by_name('Normal'), IssuePriority.default
+ end
+
+ def test_default_should_return_nil_when_no_default_priority
+ IssuePriority.update_all :is_default => false
+ assert_nil IssuePriority.default
+ end
+
def test_should_be_an_enumeration
assert IssuePriority.ancestors.include?(Enumeration)
end