diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2009-10-21 22:34:34 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2009-10-21 22:34:34 +0000 |
commit | 29301c8a381aa5995a0ce2e10ad91f210dc6464f (patch) | |
tree | 5d855e29cb37ca5e2dc28a76a9b1bd4c781cce08 /test/unit/enumeration_test.rb | |
parent | e76d4c5c4c3f2beb8be1f441148e4627a14d37d1 (diff) | |
download | redmine-29301c8a381aa5995a0ce2e10ad91f210dc6464f.tar.gz redmine-29301c8a381aa5995a0ce2e10ad91f210dc6464f.zip |
Added project specific Enumeration overrides.
These will be used to track if Enumeration's custom data or active state
is overridden on a project. An overridden Enumeration is one that is associated
with a parent Enumeration.
#4077
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2947 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/enumeration_test.rb')
-rw-r--r-- | test/unit/enumeration_test.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/unit/enumeration_test.rb b/test/unit/enumeration_test.rb index 663077352..abb15353a 100644 --- a/test/unit/enumeration_test.rb +++ b/test/unit/enumeration_test.rb @@ -86,4 +86,26 @@ class EnumerationTest < ActiveSupport::TestCase assert Enumeration.included_modules.include?(Redmine::Acts::Customizable::InstanceMethods) end + def test_should_belong_to_a_project + association = Enumeration.reflect_on_association(:project) + assert association, "No Project association found" + assert_equal :belongs_to, association.macro + end + + def test_should_act_as_tree + enumeration = Enumeration.find(4) + + assert enumeration.respond_to?(:parent) + assert enumeration.respond_to?(:children) + end + + def test_is_override + # Defaults to off + enumeration = Enumeration.find(4) + assert !enumeration.is_override? + + # Setup as an override + enumeration.parent = Enumeration.find(5) + assert enumeration.is_override? + end end |