Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

order is not guaranteed by this select, so add an order and call first!

  • Loading branch information...
commit 58becf116580c37c63b89f4a660ebe293f6e7c4e 1 parent 6067d29
@tenderlove tenderlove authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  activerecord/test/cases/finder_test.rb
View
2  activerecord/test/cases/finder_test.rb
@@ -209,7 +209,7 @@ def test_first_bang_missing
end
def test_model_class_responds_to_first_bang
- assert_equal topics(:first), Topic.first!
+ assert_equal topics(:first), Topic.order(:id).first!
assert_raises ActiveRecord::RecordNotFound do
Topic.delete_all
Topic.first!

2 comments on commit 58becf1

@pixeltrix
Owner

Negates the point of the test which was to test that the AR::Base delegates to scoped, maybe just assert instead:

def test_model_class_responds_to_first_bang
    assert Topic.first!
    assert_raises ActiveRecord::RecordNotFound do
        Topic.delete_all
        Topic.first!
    end
end

The same applies for test_model_class_responds_to last_bang

@tenderlove
Owner

doh! you're right. I'll update it. Thanks!

Please sign in to comment.
Something went wrong with that request. Please try again.