TEAM GLITZY- Tanja, Jan, Severin, and Amy#65
Conversation
…m non-logged in users cannot update or delete a review
…merchants cannot edit their own products
…nly logged in users can edit reviews
…le product quantity
…been updated to include user info and status name(used to order_one now pending_order; order_two now paid_order)
…oduct show page, and updated the order of table columns
…e between category names
Home Page Styling
bEtsyWhat We're Looking For
|
CheezItMan
left a comment
There was a problem hiding this comment.
Left you some notes, overall nicely done!
| food_category.products.first.must_be_kind_of Product | ||
|
|
||
| food_category.products << products(:tears) | ||
| food_category.products.count.must_equal 2 |
There was a problem hiding this comment.
you should have a food_category.save here ensuring that no validations etc get broken.
|
|
||
| it "requires that quantity is a positive integer " do | ||
| item1.quantity.must_be_kind_of Integer | ||
| item1.quantity.must_be :>, 0 |
| @@ -0,0 +1,53 @@ | |||
| require "test_helper" | |||
There was a problem hiding this comment.
No test for available? ???
Remember to test custom methods.
|
|
||
| describe "validations" do | ||
|
|
||
| it "an order requires a status" do |
There was a problem hiding this comment.
I would also test if status is nil.
| end | ||
| end | ||
|
|
||
| describe "custom model methods" do |
There was a problem hiding this comment.
Shouldn't the total_cost method be tested in here as opposed to outside?
| delete order_item_path(soap2.id) | ||
| #Assert | ||
| OrderItem.find_by(id: soap2.id).must_equal soap2 | ||
| must_redirect_to order_path(paid.id) |
There was a problem hiding this comment.
Also some flash error message and status code should be tested.
| let(:merchant_order_item) {order_items(:orderitem4)} | ||
|
|
||
| it "ensures a paid order_item's default shipping status is: not shipped" do | ||
| login(merchant) |
| puts "order status is #{order.status}" | ||
| order.status.must_equal "incomplete" | ||
| patch place_order_path, params: order_data | ||
| order.status.must_equal "incomplete" |
There was a problem hiding this comment.
There should also be a status code and flash message to check.
|
|
||
| describe "edit" do | ||
| it "will get the edit form for an existing product" do | ||
| get edit_product_path(Product.first) |
There was a problem hiding this comment.
What about if the user isn't logged in!!!! OMG! Or if the user isn't the owner!
| describe "update" do | ||
|
|
||
| it "updates with valid data and an existing product " do | ||
| product = products(:chocolate) |
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