mirror of
https://github.com/thoughtbot/factory_bot.git
synced 2022-11-09 11:43:51 -05:00
Test the block is called in Factory#run
This commit is contained in:
parent
73b9e4196a
commit
93026a8f2f
1 changed files with 7 additions and 0 deletions
|
@ -272,4 +272,11 @@ describe FactoryGirl::Factory, "running a factory" do
|
|||
subject.run(FactoryGirl::Proxy::Build, { :name => "John Doe" })
|
||||
proxy.should have_received(:set).once
|
||||
end
|
||||
|
||||
it "calls the block and returns the result" do
|
||||
block_run = nil
|
||||
block = lambda {|result| block_run = "changed" }
|
||||
subject.run(FactoryGirl::Proxy::Build, { }, &block)
|
||||
block_run.should == "changed"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue