Permalink
Browse files

adding test

Signed-off-by: Nick Quaranto <nick@quaran.to>
  • Loading branch information...
ryana authored and qrush committed Feb 24, 2009
1 parent 7b63939 commit 3e81f7a46034b0ca811453cb84d83f2afd5f7288
Showing with 7 additions and 0 deletions.
  1. +7 −0 test/factory_test.rb
View
@@ -413,6 +413,13 @@ class FactoryTest < Test::Unit::TestCase
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) {}

0 comments on commit 3e81f7a

Please sign in to comment.