From fcb215801ebe1f2bcb0ffccaab0133adf3090d90 Mon Sep 17 00:00:00 2001 From: Luke Baker Date: Tue, 17 Jan 2012 17:14:23 -0500 Subject: [PATCH] send choice to choice tasks --- lib/tasks/test_api.rake | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/tasks/test_api.rake b/lib/tasks/test_api.rake index 405f45e..bf0d784 100644 --- a/lib/tasks/test_api.rake +++ b/lib/tasks/test_api.rake @@ -45,7 +45,7 @@ namespace :test_api do success_message = "Choice wins equals vote wins" choice_votes_count = choice.votes.count if (choice.wins != choice_votes_count) - error_message = "Error!: Cached choice wins != actual choice wins for choice #{choice.id}, #{choice_wins} != #{choice_votes_count}\n" + error_message = "Error!: Cached choice wins != actual choice wins for choice #{choice.id}, #{choice.wins} != #{choice_votes_count}\n" end return error_message.blank? ? [success_message, false] : [error_message, true] end @@ -117,7 +117,7 @@ namespace :test_api do question.choices.each do |choice| @choice_tasks.each do |taskname, description| - message, error_occurred = send(taskname, question) + message, error_occurred = send(taskname, choice) if error_occurred errors << message else @@ -496,7 +496,6 @@ namespace :test_api do desc "Get all question_ids before 2010_02_17" task :question_ids_with_votes_before_2010_02_17 => :environment do @question_ids_with_votes_before_2010_02_17 = Vote.find(:all, :select => "DISTINCT(question_id)", :conditions => ["created_at < ?", '2010-02-17']).map {|v| v.question_id} - puts @question_ids_with_votes_before_2010_02_17.inspect end -- libgit2 0.21.2