Skip to content

Latest commit

 

History

History
92 lines (72 loc) · 4.41 KB

File metadata and controls

92 lines (72 loc) · 4.41 KB

Takeaway Challenge

                            _________
              r==           |       |
           _  //            |  M.A. |   ))))
          |_)//(''''':      |       |
            //  \_____:_____.-------D     )))))
           //   | ===  |   /        \
       .:'//.   \ \=|   \ /  .:'':./    )))))
      :' // ':   \ \ ''..'--:'-.. ':
      '. '' .'    \:.....:--'.-'' .'
       ':..:'                ':..:'

Task


To write a Takeaway programme which will include a menu that lists dishes & prices of each dish. Customers will be able to use the programme to place an order & select several dishes they want with quantities, the programme will be able to calculate the total cost of the order as well. I will be using Twilio in order to send text messages to customers to inform them when their order will be delivered. Within the testing process, I will try to use stubs and doubles in order to isolate my tests.

Instructions


Instructions Clone this repository to your desired location, Run the command 'bundle' in the project directory to ensure you have all the gems. Run RSpec in the takeaway_challenge directory in order to run the unit tests.

User Story

As a customer
So that I can check if I want to order something
I would like to see a list of dishes with prices

As a customer
So that I can order the meal I want
I would like to be able to select some number of several available dishes

As a customer
So that I can verify that my order is correct
I would like to check that the total I have been given matches the sum of the various dishes in my order

As a customer
So that I am reassured that my order will be delivered on time
I would like to receive a text such as "Thank you! Your order was placed and will be delivered before 18:52" after I have ordered

Domain Model Table


Objects Messages
Menu/dishes list of dishes
Prices list prices of dishes
Order place an order
Text receive texts

  • Hints on functionality to implement:

    • Ensure you have a list of dishes with prices
    • The text should state that the order was placed successfully and that it will be delivered 1 hour from now, e.g. "Thank you! Your order was placed and will be delivered before 18:52".
    • The text sending functionality should be implemented using Twilio API. You'll need to register for it. It’s free.
    • Use the twilio-ruby gem to access the API
    • Use the Gemfile to manage your gems
    • Make sure that your Takeaway is thoroughly tested and that you use mocks and/or stubs, as necessary to not to send texts when your tests are run
    • However, if your Takeaway is loaded into IRB and the order is placed, the text should actually be sent
    • Note that you can only send texts in the same country as you have your account. I.e. if you have a UK account you can only send to UK numbers.
  • Advanced! (have a go if you're feeling adventurous):

    • Implement the ability to place orders via text message.
  • A free account on Twilio will only allow you to send texts to "verified" numbers. Use your mobile phone number, don't worry about the customer's mobile phone.

⚠️ WARNING: think twice before you push your mobile number or Twilio API Key to a public space like GitHub 👀

🔑 Now is a great time to think about security and how you can keep your private information secret. You might want to explore environment variables.

  • Finally submit a pull request before Monday at 9am with your solution or partial solution. However much or little amount of code you wrote please please please submit a pull request before Monday at 9am

In code review we'll be hoping to see:

  • All tests passing
  • High Test coverage (>95% is good)
  • The code is elegant: every class has a clear responsibility, methods are short etc.

Reviewers will potentially be using this code review rubric. Referring to this rubric in advance will make the challenge somewhat easier. You should be the judge of how much challenge you want this at this moment.

Notes on Test Coverage

You can see your test coverage when you run your tests.