The weekend challenge for week 2 at Makers, was making a takeaway application. It should allow the user to look at the menu, chose food to buy, see the total and pay for the whole lot, when the payment was successful, the customer should receive a text to their mobile with a confirmation and a time of the delivery. We used a service called Twilio for the texting.
If you’re interested, you can take a look at my attempt here.
First, I was a bit worried about using an API, as we hadn’t done this during the week, but actually the hardest bit, again, was Rspec and mocking out the Twilio/texts, so that there weren’t any texts sent, every time I run my tests. This could be resolved by using dependency inversion and thus injecting the twilio class into my OrderConfirmation class.
I’ve finished it but there are still a few things, I would like to update in the course of this week, such as changing the hard-coded menu and extracting it to a YAML file, or checking for refactoring some of the Ruby as well. The coaches have also provided some of their solutions, so I see if I can learn something from them too 🙂