From 48f5de5ffa55cadc1b01eddb799e34f6357e468d Mon Sep 17 00:00:00 2001 From: Luke Baker Date: Tue, 27 Mar 2012 17:32:57 -0400 Subject: [PATCH] irregular appearances only tests if choice has > 10 appearances --- lib/tasks/test_api.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/test_api.rake b/lib/tasks/test_api.rake index 4ce6c31..0bf25f5 100644 --- a/lib/tasks/test_api.rake +++ b/lib/tasks/test_api.rake @@ -319,9 +319,9 @@ namespace :test_api do # this choice appears to have been deactivated then reactivated after # a period of voting - ignore_choices = [133189, 196277] + ignore_choices = [133189] appearances_by_choice_id.each do |choice_id, n_i| - if ((n_i < (mean - 6*stddev)) || (n_i > mean + 6 *stddev)) && !ignore_choices.include?(choice_id) && Choice.find(choice_id).active? + if (n_i > 10 && (n_i < (mean - 6*stddev)) || (n_i > mean + 6 *stddev)) && !ignore_choices.include?(choice_id) && Choice.find(choice_id).active? error_message = "Choice #{choice_id} in Question ##{question.id} has an irregular number of appearances: #{n_i}, as compared to the mean: #{mean} and stddev #{stddev} for this question\n" end end -- libgit2 0.21.2