Sha256: ac142067dd28e40666b885f203b5d99d0e7daa38a12af775d44097db7a434e35

Contents?: true

Size: 812 Bytes

Versions: 54

Compression:

Stored size: 812 Bytes

Contents

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

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

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
composite_primary_keys-13.0.1 test/test_tutorial_example.rb
composite_primary_keys-13.0.0 test/test_tutorial_example.rb
composite_primary_keys-12.0.10 test/test_tutorial_example.rb
composite_primary_keys-12.0.9 test/test_tutorial_example.rb
composite_primary_keys-12.0.8 test/test_tutorial_example.rb
composite_primary_keys-12.0.6 test/test_tutorial_example.rb
composite_primary_keys-12.0.5 test/test_tutorial_example.rb
composite_primary_keys-12.0.4 test/test_tutorial_example.rb
composite_primary_keys-12.0.3 test/test_tutorial_example.rb
composite_primary_keys-12.0.2 test/test_tutorial_example.rb
composite_primary_keys-11.3.1 test/test_tutorial_example.rb
composite_primary_keys-8.1.8 test/test_tutorial_example.rb
composite_primary_keys-12.0.1 test/test_tutorial_example.rb
composite_primary_keys-12.0.0 test/test_tutorial_example.rb
composite_primary_keys-12.0.0.rc5 test/test_tutorial_example.rb
composite_primary_keys-12.0.0.rc4 test/test_tutorial_example.rb
composite_primary_keys-12.0.0.rc3 test/test_tutorial_example.rb
composite_primary_keys-12.0.0.rc2 test/test_tutorial_example.rb
composite_primary_keys-12.0.0.rc1 test/test_tutorial_example.rb
composite_primary_keys-8.1.7 test/test_tutorial_example.rb