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

Added default strategy parameter

This commit is contained in:
eugenebolshakov 2009-01-08 11:43:07 -05:00 committed by Joe Ferris
parent f7a3ca5001
commit fb5a506558
3 changed files with 11 additions and 2 deletions

View file

@ -367,6 +367,15 @@ factory = Factory.new(:post)
assert_equal 'result', Factory.stub(@name, :attr => 'value')
end
should "use default strategy option as Factory.default_strategy" do
@factory.stubs(:default_strategy).returns(:create)
@factory.
expects(:run).
with(Factory::Proxy::Create, :attr => 'value').
returns('result')
assert_equal 'result', Factory.default_strategy(@name, :attr => 'value')
end
should "use the default strategy for the global Factory method" do
@factory.stubs(:default_strategy).returns(:create)
@factory.