codeforamerica / balance

A text message system for checking one's EBT card balance (SNAP benefits and more)
MIT License
47 stars 37 forks source link

Tests that verify minimal behavior for each state handler #174

Open daguar opened 10 years ago

daguar commented 10 years ago

Ideally, we'd like a single test that gets run against each state's handler to verify that it has:

  1. A PHONE_NUMBER constant, properly formatted
  2. ALLOWED_NUMBER_OF_EBT_CARD_DIGITS, formatted as an array
  3. A button_sequence method that takes an EBT card # and returns a string including that EBT card #
  4. A transcribe_balance_response method that returns the having_trouble_try_again message when transcription_text is nil

This won't obviate the need for further testing on new state handlers, but it gives a gut-check for implementers, since they can get automated feedback on whether they implemented the stuff that can be verified programmatically with a test.

cc @pui