1 # Test cases devised by Santiago that broke the Composite Primary Keys
2 # code at one point in time. But no more!!!
4 require 'abstract_unit'
5 require 'fixtures/user'
6 require 'fixtures/article'
7 require 'fixtures/reading'
9 class TestSantiago < Test::Unit::TestCase
10 fixtures :suburbs, :streets, :users, :articles, :readings
12 def test_normal_and_composite_associations
13 assert_not_nil @suburb = Suburb.find(1,1)
14 assert_equal 1, @suburb.streets.length
16 assert_not_nil @street = Street.find(1)
17 assert_not_nil @street.suburb
21 @santiago = User.find(1)
22 assert_not_nil @santiago.articles
23 assert_equal 2, @santiago.articles.length
24 assert_not_nil @santiago.readings
25 assert_equal 2, @santiago.readings.length