Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ports - Kasey, Shamira, Alex, Angela #75

Open
wants to merge 318 commits into
base: master
Choose a base branch
from

Conversation

AngelaOh
Copy link

bEtsy

Congratulations! You're submitting your assignment! These comprehension questions should be answered by all members of your team, not by a single teammate.

Comprehension Questions

Question Answer
Each team member: what is one thing you were primarily responsible for that you're proud of?
Alex: I am most proud of figuring out the logic of toggling between different states - between active and retired products and between paid and shipped orders.
Angela: While there was lots of logic in shopping cart that needed to be thought out, most proud of the css, it needed to be done and was able to make a huge difference in our team and site by firmly taking that on.
Shamira: Taking control of OAuth and getting everything to work. Also, styling the homepage with the slideshow was super fun.
Kasey: That I set up the database/seeding from a google doc from the beginning so we could add things to the database at our leisure. Model testing and CSS was another portion I contributed to. Finally, troubleshooting is something I enjoy as well.
Each team member: what is one thing you were primarily responsible for that you would like targeted feedback on?
Shamira: Oauth testing
Alex: the logic for shipping and cancelling order in the orders controller, and retire in the products controller
Kasey: Model Validation
Angela: Orders controller and corresponding testing - particularly when it came to tying inventory and quantity in shopping cart
How did your team break up the work to be done? We started off by splitting up the three main controllers to start with and then one person got the models. From there, we used a lot of branches in git to divide and conquer. Standups in the morning were helpful to setting up our day.
How did your team utilize git to collaborate? See above about Git Branches. We learned a lot about how to use PRs to review each other's work before merging. We also met frequently through the day to talk over everything in person.
What did your group do to try to keep your code DRY while many people collaborated on it? We definitely could have worked on this one more, but we tried to keep the collaboration area not overlap, which became more and more challenging the last couple of days of the project.
What was a technical challenge that you faced as a group? Git usage and never fully being able to get rid of the simplecov files popping up, even after doing everything we were suppose to do (everyone removing coverage files first, adding coverage to gitignore)
What was a team/personal challenge that you faced as a group? Everyone had the same personal challenges of either being stressed about Mock Interviews or worried about upsetting someone who was stressed out about Mock Interviews. That scheduling was on purpose, right?
What was your application's ERD? (include a link) https://drive.google.com/file/d/1fTikW6HNPkuS-oDLKOuusN3kGkS0FWGW/view
What is your Trello URL? https://trello.com/b/mQehHJbS/betsy-dream-team
What is the Heroku URL of your deployed application? http://toonsy.herokuapp.com/

alexandria7 and others added 30 commits May 3, 2019 16:22
This reverts commit d15f648.
Fixed logout working on OAuth testing.
Order controller - basic controller and homepage stuff
@CheezItMan
Copy link

bEtsy

What We're Looking For

Manual testing

Workflow yes / no
Deployed to Heroku Yes
Before logging in
Browse all products, by category, by merchant Yes
Leave a review No
Verify unable to create a new product Yes
After logging in I can't log in on heroku!
Create a category No way to add a category
Create a product in that category with stock 10 yes
Add the product you created to your cart yes
Add it again (should update quantity) This causes a duplicate orderitem on the cart
Verify unable to increase quantity beyond stock By putting two orders for the same item in the cart I can order more than is available. When I check out only inventory is decreased by only 1! Doh!
Add another merchant's product Yes
Check out Yes
Check that stock was reduced Only by one item
Change order-item's status on dashboard Yes
Verify unable to leave a review for your own product NO REVIEW FUNCTIONALITY
Verify unable to edit another merchant's product by manually editing URL OOPS I could mark down another merchant's product-price down to $1. HAHAHAHA I am the HACKER-MASTER!
Verify unable to see another merchant's dashboard by manually editing URL Yes
Feedback to the team The validation errors for adding a new product seem... weird.

Code Review

Area yes / no
Routes
No un-needed routes generated (check reviews) Yes
Routes not overly-nested (check products and merchants) Some overly nested routes, see inline comments
Merchant dashboard and cart page use a non-parameterized routes (should pull merchant or cart ID from session) You use the merchant id in the dashboard route, you don't need it since it's in session.
Controllers
Controller-filter to require login by default Only on UsersController
Helper methods or filters to find logged-in user, cart, product, etc Some filters in place, but not many
No excessive business logic Little bit of weird stuff in your views, but otherwise good business logic in the models.
Business logic that ought to live in the model
Add / remove / update product on order Yes
Checkout -> decrease inventory Sorta (see above)
Merchant's total revenue Yes
Find all orders for this merchant (instance method on Merchant) Yes
Selected Model Tests
Add item to cart:
- Can add a good product
- Can't add a product w/o enough stock
- Can't add a retired product
- Can't add to an order that's not in cart mode
- Logic specific to this implementation
No testing of adding a product to an order through orderitem, no tests for retired products or adding to orders not in "pending" mode.
Get orders for this merchant:
- Includes all orders from this merchant
- Doesn't include orders from another merchant
- Orders are not included more than once
- Does something reasonable when there are no orders for this merchant
Yes
Model testing in general You could definitely have more model methods, like adding a product to an order, etc.
Selected Controller Tests
Add item to cart:
- Empty cart (should be created)
- Cart already exists (should add to same order)
- Product already in cart (should update quantity)
- Bad product ID, product is retired, quantity too high, or something like that (error)
Yes
Leave a review:
- Works when not logged in
- Works when logged in as someone other than the product's merchant
- Doesn't work if logged in as this product's merchant
- Doesn't work if validations fail
NA

Overall Feedback

Great work overall! You've built a fully functional web store from top to bottom. This represents a huge amount of work, and you should be proud of yourselves!.

I am particularly impressed by the way that you had some nice styling (good front page), and had good test coverage. You also seemed as a team to work really well together. You also had a pretty smooth checkout process.

I do see some room for improvement around more security as I was able to "hack"your site. Spending some time playing gremlin user would be a good idea. You also didn't get to categories or reviews, except for viewing categories. Your Heroku also won't let me log in (local works). Lastly you do need more through model testing and moving more business logic into the model. I suggest creating an add-to-order method as a model method to either product or order.

bEtsy is a huge project on a very short timeline, and this feedback should not at all diminish the magnitude of what you've accomplished. Keep up the hard work!

Only the person who submitted the PR will get an email about this feedback. Please let the rest of your team know about it.

resources :products, except: [:show]
end

resources :categories, only: [:show]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No way to create a category?


resources :categories, only: [:show]

get "/products", to: "products#index", as: "products"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not do resources for products


get "/products", to: "products#index", as: "products"
get "/products/:id", to: "products#show", as: "product"
patch "/users/:user_id/products/:id/retire", to: "products#retire", as: "product_retire"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have unnecessary route parameters for this route.

<% @items.each_with_index do |item, i| %>
<div class="item-info">
<img src= <%= Product.find_by(id: item.product_id).photo_url %> >
<p><%= i + 1 %>. <%= link_to Product.find_by(id: item.product_id).name, product_path(item.product_id) %> </p>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could just do:

<%= image_tag item.product.photo_url, "alt": item.product.name %>
<%= i + 1 %> <%= link_to item.product.name, product_path(item.product_id) %>

it "creates new order and holds associated order_items if order doesnt not already exist" do
get cart_path

expect(session[:order_id]).must_equal Order.last.id

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be clear, the new order can't be guaranteed to be the last one.

end

it "updates the quantity for correct orderitem when an existing orderitem is added to (via product#show)" do
post add_item_path(product.id), params: {quantity: 1}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this test is working given your running instance in Heroku.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants