Add content type checks to api/v2 request specs (#31983)
This commit is contained in:
parent
171394e914
commit
d55f4fbda1
12 changed files with 188 additions and 0 deletions
|
@ -21,6 +21,9 @@ RSpec.describe 'Media API', :attachment_processing do
|
|||
expect(response)
|
||||
.to have_http_status(200)
|
||||
|
||||
expect(response.content_type)
|
||||
.to start_with('application/json')
|
||||
|
||||
expect(response.parsed_body)
|
||||
.to be_a(Hash)
|
||||
end
|
||||
|
@ -38,6 +41,9 @@ RSpec.describe 'Media API', :attachment_processing do
|
|||
expect(response)
|
||||
.to have_http_status(202)
|
||||
|
||||
expect(response.content_type)
|
||||
.to start_with('application/json')
|
||||
|
||||
expect(response.parsed_body)
|
||||
.to be_a(Hash)
|
||||
end
|
||||
|
@ -63,6 +69,9 @@ RSpec.describe 'Media API', :attachment_processing do
|
|||
expect(response)
|
||||
.to have_http_status(422)
|
||||
|
||||
expect(response.content_type)
|
||||
.to start_with('application/json')
|
||||
|
||||
expect(response.parsed_body)
|
||||
.to be_a(Hash)
|
||||
.and include(error: /File type/)
|
||||
|
@ -80,6 +89,9 @@ RSpec.describe 'Media API', :attachment_processing do
|
|||
expect(response)
|
||||
.to have_http_status(500)
|
||||
|
||||
expect(response.content_type)
|
||||
.to start_with('application/json')
|
||||
|
||||
expect(response.parsed_body)
|
||||
.to be_a(Hash)
|
||||
.and include(error: /processing/)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue