-
Notifications
You must be signed in to change notification settings - Fork 50
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
Leaves - Cloudy #49
base: master
Are you sure you want to change the base?
Leaves - Cloudy #49
Conversation
…ing .join. super lame.
Grocery StoreWhat We're Looking For
|
describe "Order.all" do | ||
it "Returns an array of all orders" do | ||
# TODO: Your test code here! | ||
end | ||
|
||
it "Returns accurate information about the first order" 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.
This test fails, see comment in orders.rb
# Check that all data was loaded as expected | ||
expect(order.id).must_equal id | ||
expect(order.products).must_equal products | ||
expect(order.customer).must_be_kind_of Customer | ||
expect(order.customer.id).must_equal customer_id | ||
expect(order.fulfillment_status).must_equal fulfillment_status | ||
end | ||
|
||
it "Returns accurate information about the last order" do | ||
# TODO: Your test code here! |
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.
It's a good idea to scan your code for TODO:
s before submitting.
} | ||
customer_id = order[2] | ||
fulfillment_status = order[3] | ||
order = Order.new(order_id, products, customer_id, fulfillment_status) |
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.
As written, this code will always fail. initialize
is expecting a :symbol
for fulfillment_status
(see lines 13-15). Your test caught this, but it looks like it didn't get fixed.
Grocery Store
Congratulations! You're submitting your assignment.
Comprehension Questions
raise ArgumentError
?.all
&.find
methods class methods? Why not instance methods?Order
andCustomer
. Is this relation one-to-one, one-to-many, or something else? How does that compare to the Solar System project?Order
andCustomer
tracked in the CSV file? How is it tracked in your program? Why might these be different?