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
This commit is contained in:
parent
44c15c7560
commit
3478a21c2f
|
@ -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'
|
||||
|
|
Loading…
Reference in New Issue