1 require 'abstract_unit'
2 require 'fixtures/kitchen_sink'
3 require 'fixtures/reference_type'
5 class TestAttributeMethods < Test::Unit::TestCase
6 fixtures :kitchen_sinks, :reference_types
8 def test_read_attribute_with_single_key
9 rt = ReferenceType.find(1)
10 assert_equal(1, rt.reference_type_id)
11 assert_equal('NAME_PREFIX', rt.type_label)
12 assert_equal('Name Prefix', rt.abbreviation)
15 def test_read_attribute_with_composite_keys
16 sink = KitchenSink.find(1,2)
17 assert_equal(1, sink.id_1)
18 assert_equal(2, sink.id_2)
19 assert_equal(Date.today, sink.a_date.to_date)
20 assert_equal('string', sink.a_string)