Ports - Sopheary, Stephanie, Kim, Kate#71
Ports - Sopheary, Stephanie, Kim, Kate#71sophearychiv wants to merge 483 commits intoAda-C11:masterfrom
Conversation
Kf/orderitems controller
kf/merchant_model_tests
kf/shipped_status
bEtsyWhat We're Looking ForManual testing
Code Review
Overall FeedbackGreat 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 styled the app and had good test coverage. I do see some room for improvement around handling duplicate items in the orders, and not having unneeded route parameters. Further you needed a bit of work to prevent unauthorized users from performing actions on your site. Only the person who submitted the PR will get an email about this feedback. Please let the rest of your team know about it. |
| # post "/orders/checkout", to: "orders#checkout" | ||
| resources :sessions, only: [:new, :create] | ||
| resources :merchants, except: [:new, :create] | ||
| resources :merchants do |
There was a problem hiding this comment.
You are defining the merchants routes twice!
| resources :merchants do | ||
| resources :orders, only: [:index] | ||
| end | ||
| get "/merchants/:id/dashboard", to: "merchants#dashboard", as: "dashboard" |
There was a problem hiding this comment.
You don't need the merchant's ID, as it's in session
| @@ -0,0 +1,114 @@ | |||
| class OrdersController < ApplicationController | |||
| before_action :find_order, only: [:edit, :update, :show, :review, :confirmation] | |||
|
|
|||
| @@ -0,0 +1,101 @@ | |||
| class OrderitemsController < ApplicationController | |||
| def create | |||
There was a problem hiding this comment.
You might need a require_login filter for some OrderItems actions
| redirect_to root_path | ||
| else | ||
| @order.update(status: Order::PAID) | ||
| session[:order_id] = nil |
There was a problem hiding this comment.
You are not changing the quantity of the products which is available.
| expect(flash[:result_text]).must_equal "An itsy problem occurred: Can't find product" | ||
| end | ||
|
|
||
| it "will flash an error and redirect if not enough stock is available" do |
There was a problem hiding this comment.
You should also test to see if you can add multiple OrderItems with the same product to take it over the total
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