Handle 404 not found error in API

This commit is contained in:
Thibault Jouan
2015-05-01 19:56:19 +00:00
parent b3cfa88bb9
commit cd73a588b0
3 changed files with 16 additions and 0 deletions

View File

@@ -18,4 +18,12 @@ describe 'API application' do
expect(response.body).to be_empty
end
end
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.body).to be_empty
end
end
end