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

Material with data which contains spaces only shouldn't be added into the course #65

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

Comments

@Tatyana-Kravchenko
Copy link

Tatyana-Kravchenko commented Jul 1, 2022

Steps to reproduce
Teacher added new material in his course (courseId: {{courseIdForMaterials}})
Post {{host}}/api/v1/courses/{{courseIdForMaterials}}/materials
Body Request
{
"title": "QA school{{categoryPostfix}}",
"data": " ",
"order": 2
}
Tests
pm.test("Status code is 400", function () {
pm.response.to.have.status(400);
});

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

pm.test("Check the error message is correct", function () {
const jsonData = pm.response.json();
pm.expect(jsonData.errors[0].msg).equal("You are not allowed to use spaces only")
});
Actual behavior

  1. Status code is 200
  2. Response time is less than 1000 ms
  3. New material with data which contains spaces only was added
    Expected behavior
  4. Status code is 400
  5. Response time is less than 1000 ms
  6. New material with data which contains spaces only wasn't added
  7. The error text ("You are not allowed to use spaces only") is correct
    Screenshots
    If applicable, add screenshots to help explain your problem.
    image
    image
@viraxslot viraxslot added the bug Something isn't working label Jul 15, 2022
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