Commit 3b0c0ec42fa44bfcb4a388c31713320272449cc5
1 parent
1da85d1e
Exists in
master
and in
1 other branch
fix up tests that were comparing strings to ints
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
lib/tasks/test_api.rake
... | ... | @@ -235,7 +235,7 @@ namespace :test_api do |
235 | 235 | SUM(wins) AS total_wins, |
236 | 236 | SUM(losses) AS total_losses FROM choices |
237 | 237 | WHERE question_id = #{question.id}") |
238 | - if(totals["total"] != 2* question.votes_count) | |
238 | + if(totals["total"].to_i != 2* question.votes_count) | |
239 | 239 | error_message = "Question #{question.id}: Total votes != 2 x # vote objects, total: #{totals["total"]}, vote_count: #{question.votes_count}" |
240 | 240 | end |
241 | 241 | return error_message.blank? ? [success_message, false] : [error_message, true] |
... | ... | @@ -250,7 +250,7 @@ namespace :test_api do |
250 | 250 | SUM(wins) AS total_wins, |
251 | 251 | SUM(losses) AS total_losses FROM choices |
252 | 252 | WHERE question_id = #{question.id}") |
253 | - if (!totals["total"].blank? && totals["total"] % 2 != 0) | |
253 | + if (!totals["total"].blank? && totals["total"].to_i % 2 != 0) | |
254 | 254 | error_message = "Question #{question.id}: Total votes is not even: #{totals["total"]}" |
255 | 255 | end |
256 | 256 | return error_message.blank? ? [success_message, false] : [error_message, true] | ... | ... |