revamped pool tests

This commit is contained in:
albert
2011-06-10 01:02:09 -04:00
parent f67374da83
commit ca7afc10be
7 changed files with 272 additions and 153 deletions

View File

@@ -27,7 +27,7 @@ module PostSets
end
def relation
::Favorite.model_for(user.id).where("user_id = ?", user.id).order("id desc")
::Favorite.model_for(user.id).where("user_id = ?", user.id).includes(:post).order("id desc")
end
end
end

View File

@@ -19,7 +19,7 @@ module PostSets
end
def posts
@posts ||= pool.posts(pagination_options).limit(limit).all
@posts ||= pool.posts(pagination_options.merge(:limit => limit)).all
end
def reload

View File

@@ -10,7 +10,7 @@ module PostSets
def slice(relation)
if before_id
relation.where("id < ?", before_id).limit(limit).all
relation.where("id < ?", before_id).order("id desc").limit(limit).all
elsif after_id
relation.where("id > ?", after_id).order("id asc").limit(limit).all.reverse
else