By now you should be familiar with the cycle:
- Pick a new scenario to work on (you should have 2/4 working at this point)
- Run the scenario and watch it fail
- Develop code that makes each step of the scenario pass
- Repeat till all steps passing.
Use this process to develop the code for the remaining actions win
and
lose
. You will need to add code to the show
action that checks
whether the game state it is about to show is actually a winning or
losing state, and if so, it should redirect to the appropriate win
or
lose
action. Recall that your game logic model has a method for
testing if the current game state is win, lose, or keep playing.
The scenario game_over.feature
tests these behaviors in your SaaS app.
Push to Heroku and make sure everything still works. Give yourself a break and play a few rounds of hangperson.
While you're playing, what happens if you directly add
/win
to the end of your app's URL? Make sure the player cannot cheat by
simply visiting GET /win
. Consider how to modify the actions for win
, lose
, and show
to prevent this behavior.
- What to submit: Make sure all Cucumber scenarios are passing. A
shorthand way to run all of them is
cucumber features/
which runs all.feature
files in the given directory.
When all scenarios are passing, deploy to Heroku and submit the URL of your deployed game.
Note: Make sure the Heroku URL does not begin with https
but with http
, or you may get a socket error message. For example, if your app name on heroku is 'dragon-4582', then the proper Heroku URL would be 'dragon-4582.herokuapp.com' with nothing else.
Next: Conclusion