diff options
author | Aditya Kapoor <aditya.kapoor@vinsol.com> | 2014-06-11 23:18:47 +0530 |
---|---|---|
committer | Aditya Kapoor <aditya.kapoor@vinsol.com> | 2014-06-11 23:18:47 +0530 |
commit | 23992077894d68aaa5ba910c589bd87b3f05248c (patch) | |
tree | 515b1fae1e24c76c353b20dcd9dc7eaa4fa63fbe /activemodel/test | |
parent | b6d3fa130092070aea9dddaec57b3e85b0e7ecce (diff) | |
download | rails-23992077894d68aaa5ba910c589bd87b3f05248c.tar.gz rails-23992077894d68aaa5ba910c589bd87b3f05248c.tar.bz2 rails-23992077894d68aaa5ba910c589bd87b3f05248c.zip |
[ci skip] add tests for ActionModel::Conversion
Diffstat (limited to 'activemodel/test')
-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? |