Coder Social home page Coder Social logo

takeaway's Introduction

Takeaway App

Week 2 Challenge Instructions

Write a class Takeaway with the following functionality:

  • A list of dishes with prices
  • Placing the order by giving the list of dishes, their quantities and a number that should be the exact total. * Send the customer a text saying 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"
  • Implement the text sending functionality using Twilio API
  • Use a Gemfile to manage your gems
  • Make sure that your Takeaway class 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 class is loaded into IRB and the order is placed, the text should actually be sent

Technologies Used

  • Ruby
  • RSpec
  • Twilio API
  • Webmock

To Run

git clone [email protected]:deniseyu/takeaway.git
cd takeaway
bundle install

Create a developer account on Twilio to get an authentication credentials. In command line, configure the SID, auth token, your Twilio number, and your mobile number as environment variables (without curly braces):

export MY_NUMBER={your number goes here}
export TWILIO_NUMBER={your number assigned by Twilio}
export TWILIO_ACCOUNT_SID={your SID}
export TWILIO_AUTH_TOKEN={your auth token}

To test, run 'rspec' from command line.

Program Design

This program contains four classes: the menu, the order, the line item, and sending an SMS.

To Do

A previous version had all RSpec tests passing with a real mobile endpoint. With Webmock, tests for the stubbed POST requests to the Twilio API need to be rewritten.

takeaway's People

Contributors

deniseyu avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.