-
Notifications
You must be signed in to change notification settings - Fork 14
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
TEAM GLITZY- Tanja, Jan, Severin, and Amy #65
base: master
Are you sure you want to change the base?
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
|
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
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.
These two seem redundant.
@@ -0,0 +1,53 @@ | |||
require "test_helper" |
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 for available?
???
Remember to test custom methods.
|
||
describe "validations" do | ||
|
||
it "an order requires a status" 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.
I would also test if status
is nil
.
end | ||
end | ||
|
||
describe "custom model methods" 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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
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.
Why login?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
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.
Ditto!
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