closes OUT-1855, OUT-2214
test plan:
- create an access token, which will be used below
to perform HTTP requests, see:
https://canvas.instructure.com/doc/api/file.oauth.html#using-access-tokens
- using a tool like Postman, set an outcome proficiency
for an account. perform a POST request at the endpoint
`http://canvas.docker/api/v1/accounts/1/outcome_proficiency`
with a `Content-Type` header value `application/json`
and body with content like:
{
"ratings": [
{
"description": "great work",
"points": 10,
"mastery": true,
"color": "00ff00"
}
]
}
- retrieve the saved proficiency by performing GET request
at the endpoint
`http://canvas.docker/api/v1/accounts/1/outcome_proficiency`.
it should match the proficiency created above.
- update the proficiency by doing another POST request, but
with multiple ratings, like:
{
"ratings": [
{
"description": "great work",
"points": 10,
"mastery": true,
"color": "00ff00"
},
{
"description": "bad work",
"points": 0,
"mastery": false,
"color": "ff0000"
}
]
}
- do a GET request to confirm the above changes were saved
- do several other POST requests with multiple ratings
that contain either multiple mastery ratings or none.
these requests should fail with a 422 status code
and an error message that contains `Only one rating can have mastery`.
Change-Id: Ib301c0394a99dbf55d7d85ceef28a95075faaec2
Reviewed-on: https://gerrit.instructure.com/150095
Reviewed-by: Frank Murphy <fmurphy@instructure.com>
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Matt Berns <mberns@instructure.com>
QA-Review: Andrew Porter <hporter-c@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>