Sha256: dc9082c11ac9f742cc71b2f4aba5164315c8e8d073b5153d4b7533d62858fa38

Contents?: true

Size: 761 Bytes

Versions: 54

Compression:

Stored size: 761 Bytes

Contents

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

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

54 entries across 54 versions & 1 rubygems

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