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