Add test for `AR::Base#to_param`

According to the doc of `AR::Base#to_param`(
https://github.com/rails/rails/blob/04cda1848cb847c2bdad0bfc12160dc8d554
7775/activerecord/lib/active_record/integration.rb#L18 ), it returns
`nil` if the record is not persisted.
Merge pull request #10416 from tkhr/add-test-for-AR--Base#to_param

Add test for `AR::Base#to_param`