From 1fa059cd017c134499835593ba29620c4cd7358c Mon Sep 17 00:00:00 2001 From: Andrew White Date: Sun, 12 Jun 2011 15:03:24 +0100 Subject: Define ActiveSupport#to_param as to_str - closes #1663 --- activesupport/test/core_ext/string_ext_test.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'activesupport/test/core_ext') diff --git a/activesupport/test/core_ext/string_ext_test.rb b/activesupport/test/core_ext/string_ext_test.rb index 32675c884a..7a8cda160d 100644 --- a/activesupport/test/core_ext/string_ext_test.rb +++ b/activesupport/test/core_ext/string_ext_test.rb @@ -251,7 +251,7 @@ class StringInflectionsTest < Test::Unit::TestCase # And changes the original string: assert_equal original, expected end - + def test_string_inquiry assert "production".inquiry.production? assert !"production".inquiry.development? @@ -451,6 +451,12 @@ class OutputSafetyTest < ActiveSupport::TestCase assert !'ruby'.encoding_aware? end end + + test "call to_param returns a normal string" do + string = @string.html_safe + assert string.html_safe? + assert !string.to_param.html_safe? + end end class StringExcludeTest < ActiveSupport::TestCase -- cgit v1.2.3