From 15884175593031b3afcef93956c916282d277219 Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Wed, 6 May 2015 02:27:50 +0000 Subject: [PATCH] Refactor response status expectations in API UAT --- spec/integration/api/application_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/integration/api/application_spec.rb b/spec/integration/api/application_spec.rb index 209ef78..5db1d4f 100644 --- a/spec/integration/api/application_spec.rb +++ b/spec/integration/api/application_spec.rb @@ -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