Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @questions @delete
- Feature: delete existing question
- In order delete questions
- As a logged user
- I need to be able to delete existing question
- @smoke @delete_question
- Scenario: Delete question by author
- Given follow email users:
- | email | plainPassword | firstname | lastname |
- | question@test.com | 1234567 | FirstName | LastName |
- | comment@test.com | 1234567 | John | Smith |
- Given follow questions:
- | author | title | body |
- | question@test.com | Question Title | Question body |
- Given I remember "last created question id"
- Given I am successfully logged in with email: "question@test.com" and password: "1234567"
- When I send a DELETE request to "/api/questions/{last_created_question_id}"
- Then the response code should be 204
- @smoke @voter
- Scenario: Forbidden deleting question of other users
- Given follow email users:
- | email | plainPassword | firstname | lastname |
- | question@test.com | 1234567 | FirstName | LastName |
- | comment@test.com | 1234567 | John | Smith |
- Given follow questions:
- | author | title | body |
- | question@test.com | Question Title | Question body |
- Given I remember "last created question id"
- Given I am successfully logged in with email: "comment@test.com" and password: "1234567"
- When I send a DELETE request to "/api/questions/{last_created_question_id}"
- Then the response code should be 403
- @smoke @voter
- Scenario: Forbidden deleting of non existent question
- Given follow email users:
- | email | plainPassword | firstname | lastname |
- | question@test.com | 1234567 | FirstName | LastName |
- | comment@test.com | 1234567 | John | Smith |
- Given follow questions:
- | author | title | body |
- | question@test.com | Question Title | Question body |
- Given I remember "last created question id"
- Given I am successfully logged in with email: "question@test.com" and password: "1234567"
- When I send a DELETE request to "/api/questions/100000000000"
- Then the response code should be 404
- Then I send a DELETE request to "/api/questions/{last_created_question_id}"
- And the response code should be 204
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement