Sha256: 6296e3f969eb6297603daf30b1e485923ef8a3865b498ef828baef4eeb53261b

Contents?: true

Size: 802 Bytes

Versions: 24

Compression:

Stored size: 802 Bytes

Contents

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

class TestTutorialExample < Test::Unit::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

24 entries across 24 versions & 3 rubygems

Version Path
mingusbabcock-composite_primary_keys-2.2.2.1 test/test_tutorial_examle.rb
tyler-composite_primary_keys-1.1.0 test/test_tutorial_examle.rb
tyler-composite_primary_keys-1.1.1 test/test_tutorial_examle.rb
tyler-composite_primary_keys-1.1.2 test/test_tutorial_examle.rb
tyler-composite_primary_keys-1.1.3 test/test_tutorial_examle.rb
tyler-composite_primary_keys-1.1.4 test/test_tutorial_examle.rb
composite_primary_keys-1.0.2 test/test_tutorial_examle.rb
composite_primary_keys-0.9.91 test/test_tutorial_examle.rb
composite_primary_keys-1.0.3 test/test_tutorial_examle.rb
composite_primary_keys-0.9.90 test/test_tutorial_examle.rb
composite_primary_keys-0.9.92 test/test_tutorial_examle.rb
composite_primary_keys-0.9.93 test/test_tutorial_examle.rb
composite_primary_keys-1.0.0 test/test_tutorial_examle.rb
composite_primary_keys-1.0.1 test/test_tutorial_examle.rb
composite_primary_keys-1.0.10 test/test_tutorial_examle.rb
composite_primary_keys-1.1.0 test/test_tutorial_examle.rb
composite_primary_keys-2.2.1 test/test_tutorial_examle.rb
composite_primary_keys-2.2.2 test/test_tutorial_examle.rb
composite_primary_keys-1.0.8 test/test_tutorial_examle.rb
composite_primary_keys-1.0.7 test/test_tutorial_examle.rb