Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

teacher tries to change the course created other teacher - unexpected error message #40

Open
Tatyana-Kravchenko opened this issue Jun 24, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@Tatyana-Kravchenko
Copy link

Steps to reproduce
Teacher 2 created course (id: {{createdTeacher2courseIdforChanging}})
Teacher 2 can find this course using id,

Teacher tries to change this course
Patch{{host}}/api/v1/courses

Request Body:
{
"id": {{createdTeacher2courseIdforChanging}},
"title": "New name of course How to create test cases 1656069936 {{coursePostfix}}",
"description": "Basic course about test design technique",
"visible": true,
"categoryId": {{categoryId}}
}
Tests:
pm.test("Status code is 403", function () {
pm.response.to.have.status(403);
});

pm.test("Response time is less than 1000ms", function () {
pm.expect(pm.response.responseTime).to.be.below(1000);
});

pm.test("Error message is correct", function () {
const body = pm.response.json()
pm.expect(body.errors).to.equal("You're not owner of this course, you can't change/remove it")
});

Actual behavior
Status code: 404 Not Found
{
"errors": "Unable to find course record(s)"
}
Response time is less than 1000
Expected behavior
Status code: 403
Error: You're not owner of this course, you can't change/remove it
Response time is less than 1000
Screenshots
If applicable, add screenshots to help explain your problem.
BugRepor_Unexpected error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants