1
0
Fork 0
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:
Joshua Clayton 2011-10-26 23:51:25 -04:00
parent 73b9e4196a
commit 93026a8f2f

View file

@ -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