added post controller test

This commit is contained in:
albert
2011-01-28 18:03:00 -05:00
parent 2053e6ad8c
commit 3ba52acfe0
6 changed files with 54 additions and 6 deletions

View File

@@ -30,7 +30,7 @@ class Post < ActiveRecord::Base
scope :commented_before, lambda {|date| where("last_commented_at < ?", date).order("last_commented_at DESC")}
scope :available_for_moderation, lambda {where(["id NOT IN (SELECT pd.post_id FROM post_disapprovals pd WHERE pd.user_id = ?)", CurrentUser.id])}
scope :hidden_from_moderation, lambda {where(["id IN (SELECT pd.post_id FROM post_disapprovals pd WHERE pd.user_id = ?)", CurrentUser.id])}
scope :before_id, lambda {|id| where(["posts.id < ?", options[:before_id]])}
scope :before_id, lambda {|id| where(["posts.id < ?", id])}
scope :tag_match, lambda {|query| Post.tag_match_helper(query)}
module FileMethods