-
Notifications
You must be signed in to change notification settings - Fork 45
Luxi Lindsey - Grocery Store - Octos #24
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
base: master
Are you sure you want to change the base?
Conversation
…ch product's price to get the sub total. Then I got the final product total by adin the sub total to the sub total multiply by .075 and rounding to the two decimal places.
…nt that will add the new product if the hash does not have the product name already.
…information to see if I get the same expected results and I did.
…rue correct. I also added the rounding to the sub_total so that the product total is rounded to the second decimal place.
…uns and assertions.
…ad in the information from spec.
…ile. Next, I will work on pulling the first line of the whole csv file.
…I am learning how to read the csv file and working with the codes that we learned in class.
…em of the csv file.
…a line after I was able to just print the first order.
…rder into a hash. Now I will convert what I did into the array.
…o checked if the data structure you used in Wave 1 will still work for the new requirements and it did.
…the id's were not printing correctly. I went back and fixed the issue and the Order#self.all method is printing the id's correctly.
…roducts based on the id that is called. Also, the method will call nil if the ID called does not find the object.
…gh successfully. I unblocked the Wave 1 test and everything ran through successfully as well.
…m the Order class. I tested out the code using ui to see if it works.
…I tried to folow the same list of tests from Wave 1 test under the describe initialize for order.rb. But, I keep getting errors. I am going to come back to this later.
…lineOrder class. I tested it out using ui and I got the total that I expected. yaay.
…ly if there are products. When there are no products to return nil.
… if the online order status is pending or paid.
….csv from the spec file. Also, the OnlineOrder#self.all method will read each online order into an array separating the parameters. In addition, I updated the online_order_spec.rb file to successfuly run all the tests for describe '#add_product' and describe '#OnlineOrder.all'.
…f I can just go super to call from the Order call because nothing in the code changed for the OnlineOrder class.
…o NilClass so that the tests all successfully passed.
…hen I just did status it said it was not set up... so this is my final commit for my order_spec.rb.
I removed my comments and UI below the code.
I removed my comments and UI at the bottom of the code.
I removed the extra comments. Updated comments for the skipped tests and updated lines 64 and 65.
I removed the extra comments and instructions
Grocery StoreWhat We're Looking For
Good work overall. Stylistically the code looks good and functions well. One small thing about constant variables: The tests are a little "rough"! To write effective tests, you should think about the following:
For instance, you have some tests in the order spec about it "Returns accurate information about the last order" do
order = Grocery::Order.all
order[99].must_be_kind_of Grocery::Order
endYou successfully test that the order at index 99 should be an instance of the It would be great if you could verify that the information about the last order that we know from the CSV (it has an ID of 100, and the products represented by the string "Allspice:64.74;Bran:14.72;UnbleachedFlour:80.59"). You can do things like that with I think you're on your way to writing better tests in the future :) Good job overall! |
Grocery Store
Congratulations! You're submitting your assignment.
Comprehension Questions
raise ArgumentError?.all&.findmethods class methods? Why not instance methods?