diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-12-14 18:02:04 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-12-14 18:02:04 +0000 |
commit | 7a224356a88f104b6bf012e930721efb2274c2b1 (patch) | |
tree | 87752422f27842ef894f873dd490e5816973cc06 /activesupport/test | |
parent | 3aa54c5e44f8f0d9e5ed7a346084884ed07b89d0 (diff) | |
download | rails-7a224356a88f104b6bf012e930721efb2274c2b1.tar.gz rails-7a224356a88f104b6bf012e930721efb2274c2b1.tar.bz2 rails-7a224356a88f104b6bf012e930721efb2274c2b1.zip |
Added that Array#to_param calls to_param on all it's elements (closes #10473) [brandon]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8384 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/array_ext_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/array_ext_test.rb b/activesupport/test/core_ext/array_ext_test.rb index d8ec45b62a..840a4c81d1 100644 --- a/activesupport/test/core_ext/array_ext_test.rb +++ b/activesupport/test/core_ext/array_ext_test.rb @@ -16,6 +16,12 @@ class ArrayExtAccessTests < Test::Unit::TestCase end class ArrayExtToParamTests < Test::Unit::TestCase + class ToParam < String + def to_param + "#{self}1" + end + end + def test_string_array assert_equal '', %w().to_param assert_equal 'hello/world', %w(hello world).to_param @@ -25,6 +31,10 @@ class ArrayExtToParamTests < Test::Unit::TestCase def test_number_array assert_equal '10/20', [10, 20].to_param end + + def test_to_param_array + assert_equal 'custom1/param1', [ToParam.new('custom'), ToParam.new('param')].to_param + end end class ArrayExtToSentenceTests < Test::Unit::TestCase |