#controller file
def update
@payment = Payment.find_by(reference_id: params[:reference_id])
if @payment.update(update_params)
@payment.do_something
end
end
when trying to spec if do_something method was called, by
expect(@payment).to receive(:do_something)
it says
expected: 1 time with any arguments
received: 0 times with any arguments
do_something is in my Payment Class. It is actually being called, but rspec says not.
Any ideas? thanks in advance