Sha256: accfe7864edaae35a861f416ac0104b478994818c09653853d89037f87068e98

Contents?: true

Size: 706 Bytes

Versions: 3

Compression:

Stored size: 706 Bytes

Contents

# Test cases devised by Santiago that broke the Composite Primary Keys
# code at one point in time. But no more!!!
require './abstract_unit'

class TestSantiago < ActiveSupport::TestCase
  fixtures :suburbs, :streets, :users, :articles, :readings
  
  def test_normal_and_composite_associations
    assert_not_nil @suburb = Suburb.find(1,1)
    assert_equal 1, @suburb.streets.length
    
    assert_not_nil @street = Street.find(1)
    assert_not_nil @street.suburb
  end
  
  def test_single_keys
    @santiago = User.find(1)
    assert_not_nil @santiago.articles
    assert_equal 2, @santiago.articles.length
    assert_not_nil @santiago.readings
    assert_equal 2, @santiago.readings.length
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
composite_primary_keys-4.0.0 test/test_santiago.rb
composite_primary_keys-4.0.0.beta9 test/test_santiago.rb
composite_primary_keys-4.0.0.beta8 test/test_santiago.rb