Permalink
Browse files

ignore a couple of AR 3.0 deprecation warnings in test suite

  • Loading branch information...
1 parent 1c3e836 commit d99caaa67a0919fe523b0857b35e26e27d32201e @mislav committed Sep 17, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 spec/finders/active_record_spec.rb
@@ -320,7 +320,7 @@
lambda {
# with association-specified order
- result = dhh.projects.paginate(:page => 1)
+ result = ignore_deprecation { dhh.projects.paginate(:page => 1) }
result.should == expected_name_ordered
result.total_entries.should == 2
}.should run_queries(2)
@@ -411,7 +411,7 @@
it "should paginate on habtm association" do
project = projects(:active_record)
lambda {
- result = project.developers.poor.paginate :page => 1, :per_page => 1
+ result = ignore_deprecation { project.developers.poor.paginate :page => 1, :per_page => 1 }
result.size.should == 1
result.total_entries.should == 1
}.should run_queries(2)
@@ -461,6 +461,10 @@
protected
+ def ignore_deprecation
+ ActiveSupport::Deprecation.silence { yield }
+ end
+
def run_queries(num)
QueryCountMatcher.new(num)
end

0 comments on commit d99caaa

Please sign in to comment.