-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VCR integration #320
VCR integration #320
Conversation
Initial checkin payment spec first cassettes
Move payment received functionality to model added specs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work man! Tests now pass in 6 seconds!!! Whoohoo!
Can you add to README instructions on how to regenerate cassettes if any of the APIs change? Or how to turn off using cassettes and turn on cassette generation?
I left a couple of tiny questions but this is nearly ready to go.
@@ -141,6 +141,7 @@ def retrieve_payment_intent | |||
end | |||
|
|||
Rails.logger.debug { "retrieve_payment_intent payment => #{inspect}}" } | |||
self.payment_intent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove self since it's a reader
app/models/payment.rb
Outdated
# mark payment received and ticket request completed | ||
# Send off PaymentMailer for payment received | ||
def request_completed | ||
mark_received |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to wrap these two in a transaction?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll move the transaction from the controller.
ticket_request.mark_complete | ||
Payment.transaction do | ||
# set payment and ticket request status | ||
mark_received |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving, minus the extraneous begin/rescue in a method.
any method entry works just like begin
and so you can rescue any exception within the method without the explicit and unnecessary begin
Initial checkin
payment spec first cassettes