adding test

Signed-off-by: Nick Quaranto <nick@quaran.to>
This commit is contained in:
Ryan Angilly 2009-02-24 12:15:35 -05:00 committed by Nick Quaranto
parent 7b6393979c
commit 3e81f7a460
1 changed files with 7 additions and 0 deletions

View File

@ -413,6 +413,13 @@ factory = Factory.new(:post)
child = Factory.define(:child, :parent => :object) {}
assert_equal @parent.build_class, child.build_class
end
should 'create a new factory while overriding the parent class' do
class Other; end
child = Factory.define(:child, :parent => :object, :class => Other) {}
assert_equal Other, child.build_class
end
should 'create a new factory with attributes of the parent' do
child = Factory.define(:child, :parent => :object) {}