-
Notifications
You must be signed in to change notification settings - Fork 16
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 - Sopheary, Stephanie, Kim, Kate #71
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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] | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No require_login
filter?
@@ -0,0 +1,101 @@ | |||
class OrderitemsController < ApplicationController | |||
def create |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should also test to see if you can add multiple OrderItem
s 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