On 17/10/2011, at 08:08 , KIR wrote: > > Thanks a lot for the hint, will investigate it. > May be, I'll be able to rewrite my assert_no_database assertion using its > approach.
There's assert_queries/assert_no_queries in the test case support code, which sound quite similar to what you want. But it needs a subscriber implementation (such as Mislav was talking about for will_paginate), which you need to feed into the global variable that the assertions check. Rails has a subscriber implementation for its own tests, but it isn't exposed. IMHO it would be great it did, so we could just instantiate that in app test code without having to copy it in (it's somewhat version-specific). Have a look at activerecord/test/cases/helper.rb to see how it works. The assertions that use it are defined in activerecord/lib/active_record/test_case.rb, so they are exposed, which doesn't make much sense at the moment. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
