diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-08-22 16:31:13 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-08-22 16:31:13 +0000 |
commit | 3478a21c2fe598cb562d5f3d5387c5d6f8f6f4c4 (patch) | |
tree | 8e42c934306209df071f4e5f0eceba7e211372e2 /test/unit/enumeration_test.rb | |
parent | 44c15c7560e83879996dd92a89347e50365f8ba7 (diff) | |
download | redmine-3478a21c2fe598cb562d5f3d5387c5d6f8f6f4c4.tar.gz redmine-3478a21c2fe598cb562d5f3d5387c5d6f8f6f4c4.zip |
add unit test that enumeration returns default in regardless of active or not
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10231 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/enumeration_test.rb')
-rw-r--r-- | test/unit/enumeration_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unit/enumeration_test.rb b/test/unit/enumeration_test.rb index 56be566e7..8511fa255 100644 --- a/test/unit/enumeration_test.rb +++ b/test/unit/enumeration_test.rb @@ -41,9 +41,20 @@ class EnumerationTest < ActiveSupport::TestCase e = Enumeration.default assert e.is_a?(Enumeration) assert e.is_default? + assert e.active? assert_equal 'Default Enumeration', e.name end + def test_default_non_active + e = Enumeration.find(12) + assert e.is_a?(Enumeration) + assert e.is_default? + assert e.active? + e.update_attributes(:active => false) + assert e.is_default? + assert !e.active? + end + def test_create e = Enumeration.new(:name => 'Not default', :is_default => false) e.type = 'Enumeration' |