aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/object/to_param_test.rb
blob: bd7c6c422a1b18828e6273d1126097dc1c042d54 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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