Skip to content

Commit

Permalink
ignore a couple of AR 3.0 deprecation warnings in test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Sep 17, 2011
1 parent 1c3e836 commit d99caaa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions spec/finders/active_record_spec.rb
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -461,6 +461,10 @@

protected

def ignore_deprecation
ActiveSupport::Deprecation.silence { yield }
end

def run_queries(num)
QueryCountMatcher.new(num)
end
Expand Down

0 comments on commit d99caaa

Please sign in to comment.