Refactor response status expectations in API UAT
This commit is contained in:
parent
a2488980ed
commit
1588417559
@ -12,7 +12,7 @@ describe 'API application' do
|
||||
|
||||
it 'responds with a 406 when request format is not JSON' do
|
||||
get api_ping_path, format: :xml
|
||||
expect(response.status).to be 406
|
||||
expect(response).to have_http_status 406
|
||||
expect(response.content_type).to eq :json
|
||||
expect(response.body).to be_empty
|
||||
end
|
||||
@ -23,13 +23,13 @@ describe 'API application' do
|
||||
|
||||
it 'responds with a 404 when route does not exist' do
|
||||
get '/api/not_found', format: :json
|
||||
expect(response.status).to be 404
|
||||
expect(response).to have_http_status 404
|
||||
expect(response.body).to be_empty
|
||||
end
|
||||
|
||||
it 'responds with a 404 when a resource (AR) was not found' do
|
||||
get api_playlist_path(id: 1), format: :json
|
||||
expect(response.status).to be 404
|
||||
expect(response).to have_http_status 404
|
||||
expect(response.body).to be_empty
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user