#controller file
def update
@payment = Payment.find_by(reference_id: params[:reference_id])
if @payment.update(update_params)
@payment.do_something
end
end
expect(@payment).to receive(:do_something)
它说
expected: 1 time with any arguments
received: 0 times with any arguments
do_something是我付款类。它实际上被称为,但rspec说不。
任何想法?在此先感谢