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