assert_equal 2, groups.inject(0) {|sum, group| sum + group['total'].to_i}
end
- def test_recently_updated_with_limit_scopes
+ def test_recently_updated_scope
#should return the last updated issue
- assert_equal 1, Issue.recently_updated.with_limit(1).length
- assert_equal Issue.find(:first, :order => "updated_on DESC"), Issue.recently_updated.with_limit(1).first
+ assert_equal Issue.reorder("updated_on DESC").first, Issue.recently_updated.limit(1).first
end
def test_on_active_projects_scope