]> source.dussan.org Git - redmine.git/commitdiff
add unit test to get default document category defined on database (#11665)
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 21 Aug 2012 13:45:40 +0000 (13:45 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 21 Aug 2012 13:45:40 +0000 (13:45 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10220 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/document_category_test.rb

index cbdd46fc3011e8195653f494f97b0bdddaedb8af..d3d3978bff295e7733690ff5cc09d82404d1474e 100644 (file)
@@ -32,4 +32,10 @@ class DocumentCategoryTest < ActiveSupport::TestCase
   def test_option_name
     assert_equal :enumeration_doc_categories, DocumentCategory.new.option_name
   end
+
+  def test_default
+    e = Enumeration.find_by_name('Technical documentation')
+    e.update_attributes(:is_default => true)
+    assert_equal 3, DocumentCategory.default.id
+  end
 end