thoughtbot/factory_girl — comment on commit f32651d9b20173778792691bd4e04a4d0c7bc598
File:  line 0
By yfeldblum:

The specs should also verify that the block was called.

If the block does not get called then the expectation will never be declared because the expectation is declared inside the block. Therefore there should be a separate set specifications that expect the block to be called in the first place.

it "calls the block" do
block = proc { nil }
block.should_receive(:call)
create(:company, :name => 'thoughtbot', &block)
end

This applies to each of `#create`, `#build`, `#stub`, and `#attributes_for`.