So I have a retry rule in my application. I wanted to test that using rspec.
When I call service without passing account ID it should give me false and when account ID is passed it should give me true.
I am trying this code
options = {
email: 'dev@dev.com'
}
expect_any_instance_of(PaymentService::CreatePayment).to receive(:call)
.with(options)
.and_return(false)
options[:account_id] = 12345
expect_any_instance_of(PaymentService::CreatePayment).to receive(:call)
.with(options)
.and_return(true)
But this doesnt work for me.
Aucun commentaire:
Enregistrer un commentaire