Commit 8b086743183b01393b40dda00611127ac7b63d14

Authored by Luke Baker
1 parent b2d2b343

have choice tasks use cleanup_args method

Showing 1 changed file with 10 additions and 4 deletions   Show diff stats
lib/tasks/test_api.rake
... ... @@ -40,8 +40,11 @@ namespace :test_api do
40 40 namespace :choice do
41 41 desc "Ensure that cached prompt counts are valid for a choice"
42 42 task :verify_cached_prompt_counts, [:choice_id] => :environment do |t, args|
43   - choice = Choice.find(args[:choice_id])
44   - puts verify_cached_prompt_counts(choice).inspect
  43 + a = clean_up_args(args)
  44 + choices = Choice.find(a[:choice_id])
  45 + choices.each do |choice|
  46 + puts verify_cached_prompt_counts(choice).inspect
  47 + end
45 48 end
46 49  
47 50 def verify_cached_prompt_counts(choice)
... ... @@ -54,8 +57,11 @@ namespace :test_api do
54 57  
55 58 desc "Ensure that an idea: appearances on left + appearances on right >= (wins + losses + skips)"
56 59 task :verify_choice_appearances_and_votes, [:choice_id] => :environment do |t, args|
57   - choice = Choice.find(args[:choice_id])
58   - puts verify_choice_appearances_and_votes(choice).inspect
  60 + a = clean_up_args(args)
  61 + choices = Choice.find(a[:choice_id])
  62 + choices.each do |choice|
  63 + puts verify_choice_appearances_and_votes(choice).inspect
  64 + end
59 65 end
60 66  
61 67 def verify_choice_appearances_and_votes(choice)
... ...