Skip to content

Commit

Permalink
adding test
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Quaranto <nick@quaran.to>
  • Loading branch information
ryana authored and qrush committed Mar 2, 2009
1 parent 7b63939 commit 3e81f7a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/factory_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
Expand Down

0 comments on commit 3e81f7a

Please sign in to comment.