]> git.openstreetmap.org Git - rails.git/blob - vendor/gems/composite_primary_keys-2.2.2/test/test_miscellaneous.rb
Allow the format to be selected for note API responses
[rails.git] / vendor / gems / composite_primary_keys-2.2.2 / test / test_miscellaneous.rb
1 require 'abstract_unit'
2 require 'fixtures/reference_type'
3 require 'fixtures/reference_code'
4
5 class TestMiscellaneous < Test::Unit::TestCase
6   fixtures :reference_types, :reference_codes, :products
7   
8   CLASSES = {
9     :single => {
10       :class => ReferenceType,
11       :primary_keys => :reference_type_id,
12     },
13     :dual   => { 
14       :class => ReferenceCode,
15       :primary_keys => [:reference_type_id, :reference_code],
16     },
17   }
18   
19   def setup
20     self.class.classes = CLASSES
21   end
22
23   def test_composite_class
24     testing_with do
25       assert_equal composite?, @klass.composite?
26     end
27   end
28
29   def test_composite_instance
30     testing_with do
31       assert_equal composite?, @first.composite?
32     end
33   end
34   
35   def test_count
36     assert_equal 2, Product.count
37   end
38   
39 end