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

Holy Holly -Tram, Beauttie, Ana, Gessica #83

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

Conversation

anakp07
Copy link

@anakp07 anakp07 commented Nov 26, 2020

Assignment Submission: bEtsy

Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions. These should be answered by all members of your team, not by a single teammate.

Reflection

Prompt Response
Each team member: what is one thing you were primarily responsible for that you're proud of? Beauttie: Cart/tests, login/logout, Oauth Ana: Model Merchant Model Methods/tests/summary Tram: Custom Methods for decreasing stock/ Active/Comple Order Status Gessica: Products/Categories and PAGINATION!!!! :]
Each team member: what is one thing you were primarily responsible for that you would like targeted feedback on? Beauttie: Edge case/Test coverage in cart Ana: Testing for Custom Methods in Merchant Model Tram: Custom Method Tests for Toggle for Active/Retire items Gessica: Order model testing
How did your team break up the work to be done? User stories via Trello board
How did your team utilize git to collaborate? We used branches and whenever we finished with feature we would merge to master and resolve merge conflicts daily.
What did your group do to try to keep your code DRY while many people collaborated on it? Communication who is doing what, checking others work, pair-programming on challenging features.
What was a technical challenge that you faced as a group? Getting the cart was the biggest challenge for our team as it was a new feature that we needed to understand. The cart has cross-relationships so we needed to get that working in order to move forward with the project.
What was a team/personal challenge that you faced as a group? In the start we split work between models/controllers for Products/Category, etc. vs using "User stories" but we figured it out quickly and we were able to move forward.
What was your application's ERD? (upload this to Google Drive, change the share settings to viewable by everyone with a link, and include a link) https://drive.google.com/file/d/1quA3IhpLtBghfd4Y-iDa0DZ4jEFfoD8U/view?usp=sharing
What is your Trello URL? https://trello.com/b/H11detug/holy-holly
What is the Heroku URL of your deployed application? https://holyholly.herokuapp.com/

Ana and others added 30 commits November 17, 2020 22:18
Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

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

bEtsy

Functional Requirements: Manual Testing

Workflow yes / no
Before logging in
Browse all products, by category, by merchant ✔️
Leave a review ⚠️ No review features
Verify unable to create a new product ✔️
After logging in
Create a category ✔️
Create a product in that category with stock 10 ✔️
Add the product you created to your cart ✔️
Add it again (should update quantity) ✔️
Verify unable to increase quantity beyond stock 😭, I now have 15 orders of "Fluff" in my cart and 10 in inventory!
Add another merchant's product ✔️
Check out ✔️, However if I break a validation I have to re-enter the entire order form from scratch. You should have just rendered the view.
Check that stock was reduced ✔️
Change order-item's status on dashboard ✔️, Yep, but why is "shipped" a link? If I click on it it does nothing.
Verify unable to leave a review for your own product ✔️, Can't leave a review period.
Verify unable to edit another merchant's product by manually editing URL ✔️
Verify unable to see another merchant's dashboard by manually editing URL ✔️

Major Learning Goals/Code Review

Criteria yes / no
90% reported coverage for all controller and model classes using SimpleCov ✔️ 98.25%
Routes
No un-needed routes generated (check reviews) ⚠️ there are a few here but not too bad
Routes not overly-nested (check products and merchants) ✔️
Merchant dashboard and cart page use a non-parameterized routes (should pull merchant or cart ID from session) ✔️
Controllers
Controller-filter to require login is applied to all merchant-specific actions (update/add item, add category, view merchant dashboard, etc.) - filter method is not duplicated across multiple files ✔️
Helper methods or filters to find logged-in user, cart, product, etc ✔️
No excessive business logic ✔️
Business logic that ought to live in the model
Add / remove / update product on order ✔️
Checkout -> decrease inventory ✔️
Merchant's total revenue ✔️
Find all orders for this merchant (instance method on Merchant) ⚠️, you're doing this via the controller
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 test for adding an item to an order that's shipped for example
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
⚠️ No checks to verify that order items belong to the merchant.
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)
✔️
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

Code Style Bonus Awards

Was the code particularly impressive in code style for any of these reasons (or more...?)

Quality Yes?
Perfect Indentation
Descriptive/Readable
Concise
Logical/Organized

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 did authorization with controller filters. I also like your model methods. Finally you had some good tests in there. Nice work!

Areas for improvement:

  • You would need some more through testing. I made a few notifications there.
  • There are some small styling things like lists overlapping the footer bar and your product images are not clickable. People click on shiny pictures of cookies!
  • your routes are not as dry and well-formatted as they could be
  • Check your coverage report, you're not testing the product index by category and by merchant!

Overall this is a very solid submission and y'all did a great job and should be very proud of the work you turned in.

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 :categories, only: [:index, :show, :new, :create]
resources :products
resources :order_items, only: [:destroy, :update, :create]

Choose a reason for hiding this comment

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

Do you need the create route here, since you have the nested route.

@@ -0,0 +1,144 @@
require "test_helper"

describe Merchant do

Choose a reason for hiding this comment

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

Good set of tests here.

@@ -0,0 +1,100 @@
require "test_helper"

describe OrderItem do

Choose a reason for hiding this comment

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

👍 , but... you should have a test to verify that you can't create an order item for an order that's not in cart mode. I shouldn't be able to add items to an order after it's shipped for example.

end
end

describe "update_stock" do

Choose a reason for hiding this comment

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

👍 Nice

<% Product.recently_added.each do |product| %>
<div class="col-md-4">
<div class="thumbnail">
<%= image_tag(product.photo_url, size: "250x250", alt: "product image" )%>

Choose a reason for hiding this comment

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

I would also make this image a link.

end
end

# describe "destroy" do

Choose a reason for hiding this comment

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

These are good tests, and they work if you put the destroy method back in.

However you should include tests for:

  • You have to be logged in and the owner of the product to destroy it.
  • If you're not logged in you can't delete a product
  • If you're logged in and not the owner you can't delete the product.

Comment on lines +15 to +18
def find_product
product = Product.find_by(id: self.product_id)
return product
end

Choose a reason for hiding this comment

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

Do you need this? Someone could just do order_item.product since it belongs to a product. Ditto for find_order

@@ -0,0 +1,51 @@
class Order < ApplicationRecord

Choose a reason for hiding this comment

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

👍 Good set of custom methods

Comment on lines +78 to +79
# # product = products(:product_one)
# # expect(product.merchant).must_equal merchants(:merch_one)

Choose a reason for hiding this comment

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

You had never set the product to belong to the merchant in the before block.

Comment on lines +15 to +20
describe 'index' do
it "gets index" do
get products_path
must_respond_with :success
end
end

Choose a reason for hiding this comment

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

😱

You're missing tests for product-by-category and product-by-merchant!

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