fixing tests

This commit is contained in:
albert
2011-07-16 19:20:02 -04:00
parent 7d80057e20
commit 58c3d2af13
49 changed files with 896 additions and 488 deletions

View File

@@ -4,15 +4,11 @@ module PostSets
attr_accessor :total_pages, :current_page
end
attr_reader :pool, :page, :posts
attr_reader :pool, :page
def initialize(pool, page)
def initialize(pool, page = 1)
@pool = pool
@page = page
@posts = pool.posts(:offset => offset, :limit => limit)
@posts.extend(ActiveRecordExtension)
@posts.total_pages = total_pages
@posts.current_page = current_page
end
def offset
@@ -27,6 +23,16 @@ module PostSets
["pool:#{pool.id}"]
end
def posts
@posts ||= begin
x = pool.posts(:offset => offset, :limit => limit)
x.extend(ActiveRecordExtension)
x.total_pages = total_pages
x.current_page = current_page
x
end
end
def tag_string
tag_array.join("")
end