Displaying 1 result from an estimated 1 matches for "create_initialized".
2007 Apr 20
7
Stubbing Model.new w/ block?
Ok, I followed the advice of the list and moved more code into my
model from my controller. When developing tests for this new code, I
ran into a problem...
My model code creates a receipt object and sets some values on it:
@receipt = Receipt.new do |r|
r.x = 1
r.y = 2
# etc
end
I wanted to be able to stub out Receipt.new so that I could set
expectations on the methods called on the