Ampers: Nora Peters#33
Conversation
Grocery StoreWhat We're Looking For
When I checked out your code and ran the tests, a lot of the tests broke because of Great job on the project overall! It hits all of the requirements and works as expected. I only have a few comments on small ways to improve the code stylistically:
Otherwise the tests are great! Overall you pulled out repeated code into Good work overall! |
| Grocery::OnlineOrder.all.first.id.must_equal 1 | ||
| Grocery::OnlineOrder.all.first.products.must_equal first_row_online_products | ||
| Grocery::OnlineOrder.all.first.customer_id.must_equal 25 | ||
| Grocery::OnlineOrder.all.first.status.must_equal :complete |
There was a problem hiding this comment.
Every time you have Grocery::OnlineOrder.all.first, you're calling and invoking and running Grocery::OnlineOrder.all. Which isn't a bad thing!
But it would be all the same/have less code if you just assigned the result of Grocery::OnlineOrder.all to a local variable at the top of this method:
order = Grocery::OnlineOrder.all.first
order.id.must_equal 1
order.products.must_equal first_row_online_products
order.customer_id.must_equal 25
order.status.must_equal :complete
…. Customer class and specs still incomplete
Grocery Store
Congratulations! You're submitting your assignment.
Comprehension Questions
raise ArgumentError?.all&.findmethods class methods? Why not instance methods?