@@ -34,12 +34,14 class DocumentCategoryTest < ActiveSupport::TestCase | |||||
34 | end |
|
34 | end | |
35 |
|
35 | |||
36 | def test_default |
|
36 | def test_default | |
|
37 | assert_nil DocumentCategory.find(:first, :conditions => { :is_default => true }) | |||
37 | e = Enumeration.find_by_name('Technical documentation') |
|
38 | e = Enumeration.find_by_name('Technical documentation') | |
38 | e.update_attributes(:is_default => true) |
|
39 | e.update_attributes(:is_default => true) | |
39 | assert_equal 3, DocumentCategory.default.id |
|
40 | assert_equal 3, DocumentCategory.default.id | |
40 | end |
|
41 | end | |
41 |
|
42 | |||
42 | def test_force_default |
|
43 | def test_force_default | |
|
44 | assert_nil DocumentCategory.find(:first, :conditions => { :is_default => true }) | |||
43 | assert_equal 1, DocumentCategory.default.id |
|
45 | assert_equal 1, DocumentCategory.default.id | |
44 | end |
|
46 | end | |
45 | end |
|
47 | end |
General Comments 0
You need to be logged in to leave comments.
Login now