You could create a CACHE
double and verify the following for your method:
- It calls the cache
- It uses the cache value and doesn't get the payment method if the cached value is present
- It gets the payment and saves the cache value if the cached value is not present
That's all pretty straightforward with RSpec