1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot.git synced 2022-11-09 11:43:51 -05:00

Implemented the top-level Factory method

This commit is contained in:
Joe Ferris 2008-05-28 22:20:10 -04:00
parent 218ed9a055
commit 4985bea035
2 changed files with 10 additions and 1 deletions

View file

@ -1 +1,5 @@
require 'factory_girl/factory'
def Factory (name, attrs = {})
Factory.create(name, attrs)
end

View file

@ -209,7 +209,7 @@ class FactoryTest < Test::Unit::TestCase
end
context "Factory class method" do
context "Factory class" do
setup do
@name = :user
@ -240,6 +240,11 @@ class FactoryTest < Test::Unit::TestCase
end
should "call the create method from the top-level Factory() method" do
@factory.expects(:create).with(@attrs)
Factory(@name, @attrs)
end
end
end