fixes #145: add test function for janitor trials

This commit is contained in:
albert
2011-10-21 17:56:02 -04:00
parent 0eb665af0d
commit 3b1d01370a
6 changed files with 59 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
class JanitorTrialTester
attr_reader :user
def initialize(user_name)
@user = User.find_by_name(user_name)
end
def test
if user.nil?
"User not found"
elsif user.created_at > 1.month.ago
"User signed up within the past month"
elsif user.favorites.count < 100
"User has fewer than 100 favorites"
elsif user.feedback.negative.count > 0
"User has negative feedback"
else
"No issues found"
end
end
end