I'm running the tests with latest edge rails and this one is failing:
--
test_any_should_not_load_results(NamedScopeTest)
[./test/cases/../../lib/active_record/test_case.rb:40:in
`assert_queries'
./test/cases/named_scope_test.rb:189:in
`test_any_should_not_load_results'
./test/cases/../../lib/../../activesupport/lib/active_support/
testing/setup_and_teardown.rb:94:in `__send__'
./test/cases/../../lib/../../activesupport/lib/active_support/
testing/setup_and_teardown.rb:94:in `run']:
0 instead of 1 queries were executed.
<1> expected but was
<0>.
--
Is anyone else getting this? It was added a week ago with this commit:
http://github.com/rails/rails/commit/93e10f9911fb2a096681ee0a0bc82487a9a06c44
The test itself doesn't make much sense to me. No queries should be
running because the "empty?" method is stubbed out so a Count query
never gets called. It seems the test itself is wrong, not the code.
UPDATE: I just updated mocha and now this test is passing. I'm
assuming this has to do with how "expects" gets passed to proxy_scope
and ends up loading the results performing in the 1 query. I'm posting
this anyway because I think this test should be fixed so it doesn't
rely on the version of mocha installed.