Failing Test: test_any_should_not_load_results

1 view
Skip to first unread message

Ryan Bates

unread,
Aug 1, 2008, 2:23:19 PM8/1/08
to Ruby on Rails: Core
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.

Michael Koziarski

unread,
Aug 2, 2008, 4:37:32 AM8/2/08
to rubyonra...@googlegroups.com
> 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.

Either that, or we should simply up the minimum version we support in
the uses_mocha code. Either approach seems fine to me.

Good hunting, do you want to do the honours? :)


--
Cheers

Koz

Ryan Bates

unread,
Aug 7, 2008, 10:16:41 PM8/7/08
to Ruby on Rails: Core
I'd prefer to change the test itself since others are having this
problem as well (see comment in the github commit). I'll work on
submitting a patch to lighthouse.

Regards,

Ryan

Ryan Bates

unread,
Aug 7, 2008, 10:44:05 PM8/7/08
to Ruby on Rails: Core
Here's the ticket with patch:
http://rails.lighthouseapp.com/projects/8994/tickets/782

Regards,

Ryan

Michael Koziarski

unread,
Aug 8, 2008, 4:36:29 AM8/8/08
to rubyonra...@googlegroups.com
Cheers, applied!

--
Cheers

Koz

Reply all
Reply to author
Forward
0 new messages