diff options
-rw-r--r-- | activemodel/test/cases/conversion_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activemodel/test/cases/conversion_test.rb b/activemodel/test/cases/conversion_test.rb index c5cfbf909d..800cad6d9a 100644 --- a/activemodel/test/cases/conversion_test.rb +++ b/activemodel/test/cases/conversion_test.rb @@ -24,6 +24,10 @@ class ConversionTest < ActiveModel::TestCase assert_equal "1", Contact.new(id: 1).to_param end + test "to_param returns the string joined by '-'" do + assert_equal "abc-xyz", Contact.new(id: ["abc", "xyz"]).to_param + end + test "to_param returns nil if to_key is nil" do klass = Class.new(Contact) do def persisted? |