Sha256: 249f9384eb26b8be9364bdf4fd580a8727abf4f9630541efac37471d656994cd

Contents?: true

Size: 527 Bytes

Versions: 1

Compression:

Stored size: 527 Bytes

Contents

require 'abstract_unit'
require 'fixtures/comment'
require 'fixtures/user'
require 'fixtures/employee'
require 'fixtures/hack'

class TestPolymorphic < Test::Unit::TestCase

  def setup
    create_fixtures :users, :employees, :comments, :hacks
  end
  
  
  def test_polymorphic_has_many
    comments = Hack.find('andrew').comments
    assert comments[0].person_id = 'andrew'
  end
  
  def test_polymorphic_has_one
    first_comment = Hack.find('andrew').first_comment
    assert first_comment.person_id = 'andrew'
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
composite_primary_keys-0.9.0 test/test_polymorphic.rb