diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-11 14:51:45 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-11 14:51:45 -0300 |
commit | e0063270c2ca576ee6ea77889dab7bfb7110b612 (patch) | |
tree | 515b1fae1e24c76c353b20dcd9dc7eaa4fa63fbe /activemodel | |
parent | b6d3fa130092070aea9dddaec57b3e85b0e7ecce (diff) | |
parent | 23992077894d68aaa5ba910c589bd87b3f05248c (diff) | |
download | rails-e0063270c2ca576ee6ea77889dab7bfb7110b612.tar.gz rails-e0063270c2ca576ee6ea77889dab7bfb7110b612.tar.bz2 rails-e0063270c2ca576ee6ea77889dab7bfb7110b612.zip |
Merge pull request #15643 from aditya-kapoor/add-test
[ci skip] add test for ActionModel::Conversion
Diffstat (limited to 'activemodel')
-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? |