summaryrefslogtreecommitdiffstats
path: root/test/unit/custom_value_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-10-10 10:16:00 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-10-10 10:16:00 +0000
commit6656d41a413a91a32f41e0f973c3f9db07cf9c93 (patch)
treefc1cd37b0e2801c6259c8e46eded594bf26890ef /test/unit/custom_value_test.rb
parentbcbf08017a5f038a61b4af693042bec9f1100953 (diff)
downloadredmine-6656d41a413a91a32f41e0f973c3f9db07cf9c93.tar.gz
redmine-6656d41a413a91a32f41e0f973c3f9db07cf9c93.zip
Fixes User/CustomValue association broken by r2869 (#3978).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2905 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/custom_value_test.rb')
-rw-r--r--test/unit/custom_value_test.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/unit/custom_value_test.rb b/test/unit/custom_value_test.rb
index 08492ef58..332c92644 100644
--- a/test/unit/custom_value_test.rb
+++ b/test/unit/custom_value_test.rb
@@ -18,7 +18,7 @@
require File.dirname(__FILE__) + '/../test_helper'
class CustomValueTest < ActiveSupport::TestCase
- fixtures :custom_fields
+ fixtures :custom_fields, :custom_values, :users
def test_string_field_validation_with_blank_value
f = CustomField.new(:field_format => 'string')
@@ -114,4 +114,10 @@ class CustomValueTest < ActiveSupport::TestCase
v = CustomValue.new(:custom_field => field, :value => 'Not empty')
assert_equal 'Not empty', v.value
end
+
+ def test_sti_polymorphic_association
+ # Rails uses top level sti class for polymorphic association. See #3978.
+ assert !User.find(4).custom_values.empty?
+ assert !CustomValue.find(2).customized.nil?
+ end
end