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:
parent
f7a3ca5001
commit
fb5a506558
3 changed files with 11 additions and 2 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue