Sha256: b5ae4d658ed90337b1a0a3c4c7f3b5a480b895a7b86e84cb7816614a679e395f

Contents?: true

Size: 750 Bytes

Versions: 3

Compression:

Stored size: 750 Bytes

Contents

require File.expand_path('../abstract_unit', __FILE__)

class TestTutorialExample < ActiveSupport::TestCase
  fixtures :users, :groups, :memberships, :membership_statuses
  
  def test_membership
    assert(membership = Membership.find([1, 1]), "Cannot find a membership")
    assert(membership.user)
    assert(membership.group)
  end
  
  def test_status
    assert(membership = Membership.find([1, 1]), "Cannot find a membership")
    assert(statuses = membership.statuses, "No has_many association to status")
    assert_equal(membership, statuses.first.membership)
  end
  
  def test_count
    assert(membership = Membership.find([1, 1]), "Cannot find a membership")
    assert_equal(1, membership.statuses.count)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
composite_primary_keys-7.0.16 test/test_tutorial_example.rb
composite_primary_keys-7.0.15 test/test_tutorial_example.rb
composite_primary_keys-7.0.14 test/test_tutorial_example.rb