Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

Commit

Permalink
configuration: fix behat test for multimedia upload header type (#1782)
Browse files Browse the repository at this point in the history
  • Loading branch information
rprzedzik authored Dec 10, 2021
1 parent 4329582 commit 6f432ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion module/multimedia/features/multimedia-relation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ Feature: Multimedia relations

Background:
Given I am Authenticated as "[email protected]"
And I add "Content-Type" header equal to "multipart/form-data"
And I add "Content-Type" header equal to "application/json"
And I add "Accept" header equal to "application/json"

Scenario: Upload new multimedia file
And I add "Content-Type" header equal to "multipart/form-data"
When I send a POST request to "/api/v1/multimedia/upload" with params:
| key | value |
| upload | @multimedia-test-image.png |
Expand Down
8 changes: 7 additions & 1 deletion module/multimedia/features/multimedia.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ Feature: Multimedia

Background:
Given I am Authenticated as "[email protected]"
And I add "Content-Type" header equal to "multipart/form-data"
And I add "Content-Type" header equal to "application/json"
And I add "Accept" header equal to "application/json"

Scenario: Upload new multimedia file
And I add "Content-Type" header equal to "multipart/form-data"
When I send a POST request to "/api/v1/multimedia/upload" with params:
| key | value |
| upload | @multimedia-test-image.png |
Expand All @@ -16,22 +17,26 @@ Feature: Multimedia
And store response param "id" as "multimedia_id_1"

Scenario: Upload same multimedia file again
And I add "Content-Type" header equal to "multipart/form-data"
When I send a POST request to "/api/v1/multimedia/upload" with params:
| key | value |
| upload | @multimedia-test-image.png |
Then the response status code should be 400

Scenario: Upload new multimedia file with unsupported extension
And I add "Content-Type" header equal to "multipart/form-data"
When I send a POST request to "/api/v1/multimedia/upload" with params:
| key | value |
| upload | @multimedia-test-image.abc |
Then the response status code should be 400

Scenario: Upload new multimedia file without uploaded file
And I add "Content-Type" header equal to "multipart/form-data"
When I send a POST request to "/api/v1/multimedia/upload"
Then the response status code should be 400

Scenario: Upload new multimedia with empty file
And I add "Content-Type" header equal to "multipart/form-data"
When I send a POST request to "/api/v1/multimedia/upload" with params:
| key | value |
| upload | @multimedia-test-empty-image.png |
Expand Down Expand Up @@ -75,6 +80,7 @@ Feature: Multimedia
| mime | image/png |

Scenario: Upload second multimedia file (same file different name)
And I add "Content-Type" header equal to "multipart/form-data"
When I send a POST request to "/api/v1/multimedia/upload" with params:
| key | value |
| upload | @multimedia-test-image.png |
Expand Down

0 comments on commit 6f432ce

Please sign in to comment.