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

Admin tries to add new material with not unique title in his course - Unexpected Behaviour #64

Closed
Tatyana-Kravchenko opened this issue Jul 1, 2022 · 1 comment

Comments

@Tatyana-Kravchenko
Copy link

Tatyana-Kravchenko commented Jul 1, 2022

Steps to reproduce
Admin added new material in his course (courseId: {{courseIdForMaterialsAdmin}}, title: Additional material {{materialPostfix}}, data: "New test desidn techniques", order: 3;) POST {{host}}/api/v1/courses/{{courseIdForMaterialsAdmin}}/materials
Admin saved in environment title of material as {{NotUniqueTitle}}

Admin tries to add new material with title which are existed
Post {{host}}/api/v1/courses/{{courseIdForMaterialsAdmin}}/materials
Body request:

{
"title": "{{NotUniqueTitle}}",
"data": "New test desidn techniques",
"order": 3
}

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("Check the text error of is correct", function () {
const jsonData = pm.response.json();
pm.expect(jsonData.error).equal("Title of material should be unique")
});

Actual behaviour

  1. Status code is 200
  2. Response time is less than 1000 ms
  3. New material with not unique title was added

Expected behaviour
Status code is 403

  1. Response time is less than 1000 ms
  2. New material with not unique title wasn't added
  3. Error message (Title of material should be unique) is correct

Screenshots
If applicable, add screenshots to help explain your problem.
Bug2HW16

@Tatyana-Kravchenko Tatyana-Kravchenko changed the title Admin can't add new material with not unique title in his course Admin tries to add new material with not unique title in his course - Unexpected status code Jul 1, 2022
@Tatyana-Kravchenko Tatyana-Kravchenko changed the title Admin tries to add new material with not unique title in his course - Unexpected status code Admin tries to add new material with not unique title in his course - Unexpected Behaviour Jul 1, 2022
@viraxslot
Copy link
Owner

Duplicate of #63
Please add information that you're expected this behavior for both roles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants