1 require 'abstract_unit'
2 require 'fixtures/reference_type'
3 require 'fixtures/reference_code'
5 class TestUpdate < Test::Unit::TestCase
6 fixtures :reference_types, :reference_codes
10 :class => ReferenceType,
11 :primary_keys => :reference_type_id,
12 :update => { :description => 'RT Desc' },
15 :class => ReferenceCode,
16 :primary_keys => [:reference_type_id, :reference_code],
17 :update => { :description => 'RT Desc' },
22 self.class.classes = CLASSES
27 assert_not_nil @klass_info[:update]
31 def test_update_attributes
33 assert @first.update_attributes(@klass_info[:update])
35 @klass_info[:update].each_pair do |attr_name, new_value|
36 assert_equal new_value, @first[attr_name], "Attribute #{attr_name} is incorrect"