Sha256: a1c80f1ca883f09bd2c1809122d48af90c71bd2faace233d4ffd8d61ac474b9d

Contents?: true

Size: 830 Bytes

Versions: 7

Compression:

Stored size: 830 Bytes

Contents

require 'abstract_unit'
require 'fixtures/user'
require 'fixtures/group'
require 'fixtures/membership_status'
require 'fixtures/membership'

class TestTutorialExample < Test::Unit::TestCase

  def setup
    create_fixtures :users, :groups, :memberships, :membership_statuses
  end
  
  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

7 entries across 7 versions & 1 rubygems

Version Path
composite_primary_keys-0.8.2 test/test_tutorial_examle.rb
composite_primary_keys-0.8.0 test/test_tutorial_examle.rb
composite_primary_keys-0.8.4 test/test_tutorial_examle.rb
composite_primary_keys-0.8.6 test/test_tutorial_examle.rb
composite_primary_keys-0.9.0 test/test_tutorial_examle.rb
composite_primary_keys-0.8.5 test/test_tutorial_examle.rb
composite_primary_keys-0.8.3 test/test_tutorial_examle.rb