diff --git a/lib/tasks/test_api.rake b/lib/tasks/test_api.rake index 65a653c..2a7d51b 100644 --- a/lib/tasks/test_api.rake +++ b/lib/tasks/test_api.rake @@ -235,7 +235,7 @@ namespace :test_api do SUM(wins) AS total_wins, SUM(losses) AS total_losses FROM choices WHERE question_id = #{question.id}") - if(totals["total"] != 2* question.votes_count) + if(totals["total"].to_i != 2* question.votes_count) error_message = "Question #{question.id}: Total votes != 2 x # vote objects, total: #{totals["total"]}, vote_count: #{question.votes_count}" end return error_message.blank? ? [success_message, false] : [error_message, true] @@ -250,7 +250,7 @@ namespace :test_api do SUM(wins) AS total_wins, SUM(losses) AS total_losses FROM choices WHERE question_id = #{question.id}") - if (!totals["total"].blank? && totals["total"] % 2 != 0) + if (!totals["total"].blank? && totals["total"].to_i % 2 != 0) error_message = "Question #{question.id}: Total votes is not even: #{totals["total"]}" end return error_message.blank? ? [success_message, false] : [error_message, true] -- libgit2 0.21.2