Hello! 👋
Congratulations on making it to the second round!
Your goal is to fully test the application using Rspec and Capybara
- Cover everything with tests where you think is necessary (including model tests, behaviour tests, and etc...)
- Write tests for "user_order_stats" method in app/models/order.rb
Run bundle exec rake db:seed to populate your database.
Navigation bar:
- “Home link” and “QaTest OneClass link” should direct to the homepage.
- “Juice” link should direct to /juice URL and show all the juices available in the online store.
- “Icecream” link should direct to /icecream URL and show all the ice cream available in the online store.
- “All Categories” link should direct to /all_items.
- “Login” link should direct to login page.
- “Signup” link should direct to signup page.
- “Logout” link should log out the user and clear his cart. The “Logout” link should only be visible to logged in users.
- “Cart” link should direct to /my_cart, which is only visible to logged in users AND there is at least one item in the cart.
Pages:
- "All Categories" should show all available categories links (/juice and /icecream).
- Logout view:
- Home: should have the text "Login/Signup first"
- Juice/IceCream: should have list of items with name and image
- Logged In view:
- Home: should have the text: "Navigate to different categories and choose whatever you want" and a list of my successful orders.
- Juice/IceCream: should show a list of items with name, image and 'Add to Cart' or 'Remove from cart' button.
- Cart: should be visible to logged in users, and show the following: name, img, 'Remove from Cart' button.
Buttons:
- Add to Cart: should add an item to the cart and only visible to logged in users AND this button only appears if the item is not yet added to the cart.
- Remove from Cart: should remove item from the cart and only visible to logged in users AND this button only appears if item is already in the cart.
- Order: shows on “my_cart” url only. After user click on it, it should do the following: a) Create an order record b) Clean up the user’s cart c) Show success message d) Direct to homepage
Items:
- We should only show the items if the name and image exist.
- If there is no name OR the image is broken, this item should be hidden from the list.
If you're stuck on a bug or something needs clarification you can email Max for help.
Good Luck! 🚀