Sha256: 9e525c3673819f8f6e1575794c02c896bfe0f9f003d3a63ab3be5d0972d43aec

Contents?: true

Size: 704 Bytes

Versions: 18

Compression:

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

18 entries across 18 versions & 1 rubygems

Version Path
composite_primary_keys-3.1.11 test/test_santiago.rb
composite_primary_keys-4.0.0.beta7 test/test_santiago.rb
composite_primary_keys-4.0.0.beta6 test/test_santiago.rb
composite_primary_keys-4.0.0.beta5 test/test_santiago.rb
composite_primary_keys-4.0.0.beta4 test/test_santiago.rb
composite_primary_keys-4.0.0.beta3 test/test_santiago.rb
composite_primary_keys-3.1.10 test/test_santiago.rb
composite_primary_keys-4.0.0.beta2 test/test_santiago.rb
composite_primary_keys-4.0.0.beta1 test/test_santiago.rb
composite_primary_keys-3.1.9 test/test_santiago.rb
composite_primary_keys-3.1.8 test/test_santiago.rb
composite_primary_keys-3.1.7 test/test_santiago.rb
composite_primary_keys-3.1.6 test/test_santiago.rb
composite_primary_keys-3.1.5 test/test_santiago.rb
composite_primary_keys-3.1.4 test/test_santiago.rb
composite_primary_keys-3.1.2 test/test_santiago.rb
composite_primary_keys-3.1.1 test/test_santiago.rb
composite_primary_keys-3.1.0 test/test_santiago.rb