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:
parent
218ed9a055
commit
4985bea035
2 changed files with 10 additions and 1 deletions
|
@ -1 +1,5 @@
|
|||
require 'factory_girl/factory'
|
||||
|
||||
def Factory (name, attrs = {})
|
||||
Factory.create(name, attrs)
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue