Sha256: e5cd96dfcbebd762baa647f42573c66f17635d622b07c8575d7c08029cac0e4c

Contents?: true

Size: 810 Bytes

Versions: 12

Compression:

Stored size: 810 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'
require 'fixtures/user'
require 'fixtures/article'
require 'fixtures/reading'

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

12 entries across 12 versions & 3 rubygems

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