Skip to content

Commit

Permalink
[ci skip] add tests for ActionModel::Conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Aditya Kapoor committed Jun 11, 2014
1 parent b6d3fa1 commit 2399207
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions activemodel/test/cases/conversion_test.rb
Expand Up @@ -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?
Expand Down

0 comments on commit 2399207

Please sign in to comment.