fix tests (involves changes to favorite set presenter)

This commit is contained in:
r888888888
2013-04-28 00:55:10 -07:00
parent d5f575159f
commit 5706a8e488

View File

@@ -1,13 +1,13 @@
module PostSetPresenters module PostSetPresenters
class Favorite < Base class Favorite < Base
attr_accessor :favorite_set, :tag_set_presenter attr_accessor :post_set, :tag_set_presenter
delegate :favorites, :to => :favorite_set delegate :favorites, :to => :post_set
def initialize(favorite_set) def initialize(post_set)
@favorite_set = favorite_set @post_set = post_set
@tag_set_presenter = TagSetPresenter.new( @tag_set_presenter = TagSetPresenter.new(
RelatedTagCalculator.calculate_from_sample_to_array( RelatedTagCalculator.calculate_from_sample_to_array(
favorite_set.tag_string post_set.tag_string
).map {|x| x[0]} ).map {|x| x[0]}
) )
end end
@@ -17,7 +17,7 @@ module PostSetPresenters
end end
def posts def posts
@posts ||= favorite_set.posts @posts ||= post_set.posts
end end
end end
end end