Sha256: f4a68649d3511fcb8e3abcb589c981795c19cb28603b0c1973ead990b5d88200

Contents?: true

Size: 720 Bytes

Versions: 23

Compression:

Stored size: 720 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

23 entries across 23 versions & 1 rubygems

Version Path
composite_primary_keys-6.0.8 test/test_tutorial_example.rb
composite_primary_keys-6.0.7 test/test_tutorial_example.rb
composite_primary_keys-6.0.6 test/test_tutorial_example.rb
composite_primary_keys-6.0.5 test/test_tutorial_example.rb
composite_primary_keys-6.0.3 test/test_tutorial_example.rb
composite_primary_keys-5.0.14 test/test_tutorial_example.rb
composite_primary_keys-6.0.1 test/test_tutorial_example.rb
composite_primary_keys-6.0.0 test/test_tutorial_example.rb
composite_primary_keys-5.0.13 test/test_tutorial_example.rb
composite_primary_keys-5.0.12 test/test_tutorial_example.rb
composite_primary_keys-5.0.11 test/test_tutorial_example.rb
composite_primary_keys-5.0.10 test/test_tutorial_example.rb
composite_primary_keys-5.0.9 test/test_tutorial_example.rb
composite_primary_keys-5.0.8 test/test_tutorial_example.rb
composite_primary_keys-5.0.6 test/test_tutorial_example.rb
composite_primary_keys-5.0.5 test/test_tutorial_example.rb
composite_primary_keys-5.0.4 test/test_tutorial_example.rb
composite_primary_keys-5.0.2 test/test_tutorial_example.rb
composite_primary_keys-5.0.1 test/test_tutorial_example.rb
composite_primary_keys-5.0.0 test/test_tutorial_example.rb