You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1545: Fix the `krate::downloads` test r=jtgeibel a=sgrif
This test wasn't technically wrong, it was just very confusing. The
`assert_dl_count` function was testing the length of the array returned
by the downloads endpoint. When we test that case insensitivity works,
this makes it look like there's a bug, since we'd intuitively expect
`assert_dl_count` expect 2 downloads. But it wasn't testing the number
of downloads, it was testing the number of records we returned (one
record per version per day that there were downloads). So the JSON we
returned was correct:
[
{
"version_id": 1,
"date": "2018-10-30",
"downloads": 2,
}
]
But the test didn't really reflect what we expected. This changes it to
actually test the sum of the "downloads" field, which is intuitively
what you'd expect this to be testing.
Co-authored-by: Sean Griffin <[email protected]>
0 commit comments