Technical test building a simple online shopping website for a clothing retailer. Deployed to heroku @ http://obscure-shore-1072.herokuapp.com/
Ruby 2.1.2
See feature tests for full description
- Did not add any handling for discounted products (e.g green short sleeve shirt) as was out of scope of user stories
- Could have added full logic to handle applying vouchers and then removing discounts if items are removed that render them invalid. However this was out of the scope of user stories so decided to simply lock shopping cart once the user clicks checkout and apply vouchers subsequently
- Vouchers are applied using an AJAX request. To maintain consistency the cart discounts are reset to zero if the page is reloaded
- Given more time would have handled adding/removing products from carts using AJAX requests also
- DatabaseTable: mock database functionality
- ObjectLoader: creates array of objects from flat file
- Product: basic unit of data of the site
- ShoppingCart: holds selected products and calculates total price
- Voucher: produces discounts when applied to a shopping cart
- ClothingEStore: sinatra application
To open the application on http://localhost:9292/
$ bundle
$ rackup
Feature Tests
$ bundle
$ cucumber
Unit Tests
$ bundle
$ rspec