Skip to content

Instantly share code, notes, and snippets.

@MelissaKaulfuss
Created June 3, 2019 06:04
Show Gist options
  • Save MelissaKaulfuss/7a398764c7f87a81e19564f75a600ef4 to your computer and use it in GitHub Desktop.
Save MelissaKaulfuss/7a398764c7f87a81e19564f75a600ef4 to your computer and use it in GitHub Desktop.
Tips for starting to debug acceptance specs....
  1. Put a pry in the event command handler in question for example command_handler/create_cancellation
  2. Take a look at what's happening there:
  • once you hit the pry (might be in the valid or invalid method) check out the request: request.as_mash
  • check out any errors request.errors and request.errors.full_messages
  1. Check out the error's event type Shari::Repositories::EventRecord.order(:created_at).map(&:event_type)
  2. Then drill down into that event to see the message: Shari::Repositories::EventRecord.order(:created_at).where(event_type: "reservation_acceptance_validation_failed")

This should give you a better picture of what's happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment