Sha256: 4f696ac3b80725fa65bdebacf4b9f052f0ef6599dd5b601c831ffaa393bb79b3

Contents?: true

Size: 805 Bytes

Versions: 12

Compression:

Stored size: 805 Bytes

Contents

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

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

12 entries across 12 versions & 3 rubygems

Version Path
kovyrin-composite_primary_keys-2.3.2 test/test_tutorial_examle.rb
composite_primary_keys-3.0.9 test/test_tutorial_example.rb
composite_primary_keys-3.0.8 test/test_tutorial_example.rb
composite_primary_keys-3.0.7 test/test_tutorial_example.rb
composite_primary_keys-3.0.4 test/test_tutorial_example.rb
composite_primary_keys-3.0.3 test/test_tutorial_example.rb
composite_primary_keys-3.0.0.b3 test/test_tutorial_example.rb
composite_primary_keys-3.0.0.b2 test/test_tutorial_example.rb
globe-composite_primary_keys-3.0.1 test/test_tutorial_example.rb
composite_primary_keys-2.3.5.1 test/test_tutorial_examle.rb
composite_primary_keys-2.3.5 test/test_tutorial_examle.rb
composite_primary_keys-2.3.2 test/test_tutorial_examle.rb