1 require 'abstract_unit'
2 require 'fixtures/reference_type'
3 require 'fixtures/reference_code'
5 class TestClone < Test::Unit::TestCase
6 fixtures :reference_types, :reference_codes
10 :class => ReferenceType,
11 :primary_keys => :reference_type_id,
14 :class => ReferenceCode,
15 :primary_keys => [:reference_type_id, :reference_code],
20 self.class.classes = CLASSES
26 assert_equal @first.attributes.block(@klass.primary_key), clone.attributes
28 @klass.primary_key.each {|key| assert_nil clone[key], "Primary key '#{key}' should be nil"}
30 assert_nil clone[@klass.primary_key], "Sole primary key should be nil"