-
Notifications
You must be signed in to change notification settings - Fork 15
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
Spaghettsi - Amanda, Christina, Daniela, Hannah #17
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
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.
What is http?
mock_params[:order_product][:product_id] = nil | ||
|
||
expect { | ||
post order_products_path, params: mock_params |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
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.
👍
end | ||
|
||
def mark_as_shipped | ||
if @order.status != 'complete' |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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