gdoteof / election

drupal election module
3 stars 1 forks source link

Order Election Results By Votes #13

Closed bradley-holt closed 12 years ago

bradley-holt commented 12 years ago

Description

Results for elections should be ordered by the number of votes, with the highest vote-getting candidate first.

Steps to Reproduce

curl 'https://example.org/town-meeting-season-2011/city-of-burlington/burlington-mayor' \
-H 'Accept: application/json'

Actual Results

{
   "title":"Burlington Mayor",
   …
   "results":{
      "Miro_Weinberger":{
         "votes":121,
         "complete":false
      },
      "Bob_Kiss":{
         "votes":232,
         "complete":false
      },
      "Kurt_Wright":{
         "votes":156,
         "complete":false
      }
   }
}

Expected Results

{
   "title":"Burlington Mayor",
   …
   "results":{
      "Bob_Kiss":{
         "votes":232,
         "complete":false
      },
      "Kurt_Wright":{
         "votes":156,
         "complete":false
      },
      "Miro_Weinberger":{
         "votes":121,
         "complete":false
      }
   }
}

Additional Comments

This order should be the same in HTML as well. For referendums, the "Yes" option should always be first followed by the "No" option (this appears to be correct everywhere I looked).

gdoteof commented 12 years ago

9f3d249 fixes this

acrawford commented 12 years ago

code updated on live and dev, looking good.

bradley-holt commented 12 years ago

Looks good to me.