From a5d588875f22af852324f57aedef00b1aa345c7b Mon Sep 17 00:00:00 2001 From: Kuldeep Aggarwal Date: Fri, 15 Nov 2013 20:05:17 +0530 Subject: added one test case and example for ActiveRecord::Base.to_param method --- activerecord/test/cases/integration_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activerecord/test/cases/integration_test.rb') diff --git a/activerecord/test/cases/integration_test.rb b/activerecord/test/cases/integration_test.rb index 8097f6e36e..07ffcef875 100644 --- a/activerecord/test/cases/integration_test.rb +++ b/activerecord/test/cases/integration_test.rb @@ -34,6 +34,12 @@ class IntegrationTest < ActiveRecord::TestCase assert_equal '4-a-a-a-a-a-a-a-a-a', firm.to_param end + def test_to_param_class_method_truncates_edge_case + firm = Firm.find(4) + firm.name = 'David HeinemeierHansson' + assert_equal '4-david', firm.to_param + end + def test_to_param_class_method_squishes firm = Firm.find(4) firm.name = "ab \n" * 100 -- cgit v1.2.3