Sha256: 9ae3a246af7517b36ca7efaebc194533fa615281f98e04680bb97189093119ef

Contents?: true

Size: 455 Bytes

Versions: 3

Compression:

Stored size: 455 Bytes

Contents

require 'cases/helper'
require 'models/artist'

class ToParamTest < ActiveRecord::TestCase
  fixtures :artists

  def test_to_param_returns_nil_for_new_record
    artist = Artist.new
    assert artist.new_record?
    param = artist.to_param
    assert_nil param
  end

  def test_to_param_returns_a_hex_string
    artist = Artist.first
    param = artist.to_param
    assert param.instance_of?(String)
    assert param.match(/\A[0-9a-f]{32}\z/)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gold-record-0.2.2 test/cases/to_param_test.rb
gold-record-0.2.1 test/cases/to_param_test.rb
gold-record-0.2.0 test/cases/to_param_test.rb