]> git.openstreetmap.org Git - rails.git/blob - vendor/gems/composite_primary_keys-2.2.2/test/test_santiago.rb
Bit more work on the contributor terms page - still very much a work-in-progress.
[rails.git] / vendor / gems / composite_primary_keys-2.2.2 / test / test_santiago.rb
1 # Test cases devised by Santiago that broke the Composite Primary Keys\r
2 # code at one point in time. But no more!!!\r
3 \r
4 require 'abstract_unit'\r
5 require 'fixtures/user'\r
6 require 'fixtures/article'\r
7 require 'fixtures/reading'\r
8 \r
9 class TestSantiago < Test::Unit::TestCase\r
10   fixtures :suburbs, :streets, :users, :articles, :readings\r
11   \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
15     \r
16     assert_not_nil @street = Street.find(1)\r
17     assert_not_nil @street.suburb\r
18   end\r
19   \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
26   end\r
27 end\r