aboutsummaryrefslogblamecommitdiffstats
path: root/activesupport/test/core_ext/object/to_param_test.rb
blob: bd7c6c422a1b18828e6273d1126097dc1c042d54 (plain) (tree)
1
2
3
4


                                                 
                                           














                                      
require 'abstract_unit'
require 'active_support/core_ext/object/to_param'

class ToParamTest < ActiveSupport::TestCase
  def test_object
    foo = Object.new
    def foo.to_s; 'foo' end
    assert_equal 'foo', foo.to_param
  end

  def test_nil
    assert_nil nil.to_param
  end

  def test_boolean
    assert_equal true, true.to_param
    assert_equal false, false.to_param
  end
end