Spaghettsi - Amanda, Christina, Daniela, Hannah#17
Spaghettsi - Amanda, Christina, Daniela, Hannah#17hertweckhr1 wants to merge 619 commits intoAda-C10:masterfrom
Conversation
merging in review changes
|
Hey Chris - all tests were looking super swell! In order to deploy to heroku, we needed to cahnge the semantics of the image tags - when this happened we got a few errors on our tests. Wanted to give you a heads up on this, and maybe we can over a solution, next week to this. Charles was unable to solve in the limited time we had. |
|
Don't forget to checkout our facebook and twitter :-D |
bEtsyWhat We're Looking For
Only the person who submitted the PR will get an email about this feedback. Please let the rest of your team know about it. |
| category: long | ||
| description: this is a box of spaghetti | ||
| is_active: true | ||
| image_url: http |
There was a problem hiding this comment.
This field is causing controller tests to fail because it's not giving the local address of an image in the assets folder. Either provide a full path to something on the internet or, a path to something in the assets folder.
| category: 'short', | ||
| quantity: 100, | ||
| description: 'these ones are ziti', | ||
| image_url: http |
| mock_params[:order_product][:product_id] = nil | ||
|
|
||
| expect { | ||
| post order_products_path, params: mock_params |
There was a problem hiding this comment.
This test is failing because it's trying to access user_id for a nil object.
|
|
||
|
|
||
| quantity = params[:order_product][:quantity] | ||
| if product.user_id == session[:user_id] |
There was a problem hiding this comment.
You need to first check to see if product is nil!
| valid = review.valid? | ||
|
|
||
| expect(valid).must_equal false | ||
| expect(review.errors.messages[:rating]).must_equal "can't be blank", "Rating must be greater than 0", "We're flattered but this product can |
There was a problem hiding this comment.
must_equal only takes 1 argument. So this should be an array like
must_equal ["can't be blank", "Rating must be greater than 0", "We're flattered but this product can only be rated out of 5."]
| end | ||
|
|
||
| def update | ||
| if order_product = OrderProduct.find_by(id: params[:order_product][:id]) |
There was a problem hiding this comment.
No test to make sure the current user is the "owner" of the product.
|
|
||
| def show | ||
|
|
||
| if !@order || @order.status == 'pending' || @order.user != @login_user |
| end | ||
|
|
||
| def mark_as_shipped | ||
| if @order.status != 'complete' |
There was a problem hiding this comment.
So anyone can mark an order as shipped?
| redirect_to products_path | ||
| flash[:warning] = "Error: Cannot checkout, cart is empty." | ||
|
|
||
| elsif !@login_user.update(user_params) |
There was a problem hiding this comment.
This seems like it would let anyone take over someone else's order.
| @@ -0,0 +1,47 @@ | |||
| class PaymentsController < ApplicationController | |||
| before_action :find_card_types, only: [:new, :edit, :update, :create] | |||
| def index | |||
There was a problem hiding this comment.
There's nothing here to prevent someone else from seeing the payment of another user.
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