Created
June 24, 2016 21:09
-
-
Save anonymous/8291072fbd819f2eaf134187701a8ef1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find all the cars of a given color in reverse order by created_at using the `order()` method | |
# remember time is ever increasing in a positive direction, how do you want to order ASC or DESC? | |
# assign to a variable reverse_cars | |
def test_order | |
reverse_cars = [] | |
cars = 5.times.map {Car.create} | |
# put your code here | |
reverse_cars = Car.find(color).order(created_at: :desc) | |
assert_equal cars.reverse, reverse_cars | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment