]> source.dussan.org Git - redmine.git/commitdiff
add unit test that enumeration returns default in regardless of active or not
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 22 Aug 2012 16:31:13 +0000 (16:31 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 22 Aug 2012 16:31:13 +0000 (16:31 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10231 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/enumeration_test.rb

index 56be566e748b823a225fce4c8860d9f6307454e7..8511fa2552336178d426c30d198e3a86cf8b10de 100644 (file)
@@ -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'