Commit fcb215801ebe1f2bcb0ffccaab0133adf3090d90
1 parent
671f2fd0
Exists in
master
and in
1 other branch
send choice to choice tasks
Showing
1 changed file
with
2 additions
and
3 deletions
Show diff stats
lib/tasks/test_api.rake
@@ -45,7 +45,7 @@ namespace :test_api do | @@ -45,7 +45,7 @@ namespace :test_api do | ||
45 | success_message = "Choice wins equals vote wins" | 45 | success_message = "Choice wins equals vote wins" |
46 | choice_votes_count = choice.votes.count | 46 | choice_votes_count = choice.votes.count |
47 | if (choice.wins != choice_votes_count) | 47 | if (choice.wins != choice_votes_count) |
48 | - error_message = "Error!: Cached choice wins != actual choice wins for choice #{choice.id}, #{choice_wins} != #{choice_votes_count}\n" | 48 | + error_message = "Error!: Cached choice wins != actual choice wins for choice #{choice.id}, #{choice.wins} != #{choice_votes_count}\n" |
49 | end | 49 | end |
50 | return error_message.blank? ? [success_message, false] : [error_message, true] | 50 | return error_message.blank? ? [success_message, false] : [error_message, true] |
51 | end | 51 | end |
@@ -117,7 +117,7 @@ namespace :test_api do | @@ -117,7 +117,7 @@ namespace :test_api do | ||
117 | 117 | ||
118 | question.choices.each do |choice| | 118 | question.choices.each do |choice| |
119 | @choice_tasks.each do |taskname, description| | 119 | @choice_tasks.each do |taskname, description| |
120 | - message, error_occurred = send(taskname, question) | 120 | + message, error_occurred = send(taskname, choice) |
121 | if error_occurred | 121 | if error_occurred |
122 | errors << message | 122 | errors << message |
123 | else | 123 | else |
@@ -496,7 +496,6 @@ namespace :test_api do | @@ -496,7 +496,6 @@ namespace :test_api do | ||
496 | desc "Get all question_ids before 2010_02_17" | 496 | desc "Get all question_ids before 2010_02_17" |
497 | task :question_ids_with_votes_before_2010_02_17 => :environment do | 497 | task :question_ids_with_votes_before_2010_02_17 => :environment do |
498 | @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} | 498 | @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} |
499 | - puts @question_ids_with_votes_before_2010_02_17.inspect | ||
500 | 499 | ||
501 | end | 500 | end |
502 | 501 |