Ensure AR not found errors are handled in API

This commit is contained in:
Thibault Jouan
2015-05-01 20:51:40 +00:00
parent cd73a588b0
commit 5b9d36cb39
4 changed files with 14 additions and 9 deletions

View File

@@ -22,7 +22,13 @@ describe 'API application' do
describe 'not found' do
it 'responds with a 404 when route does not exist' do
get '/api/not_found', format: :json
expect(response).to be_not_found
expect(response.status).to be 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.body).to be_empty
end
end