diff options
Diffstat (limited to 'test')
-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' |