expect a good Content-Type for all errors

pull/2733/head
Jan Sandbrink 10 years ago
parent dbee846535
commit 0f69e73421
  1. 10
      spec/requests/api/v3/support/response_examples.rb

@ -33,7 +33,15 @@ shared_examples_for 'error response' do |code, id, provided_message = nil|
provided_message || message
}
it { expect(last_response.status).to eq(code) }
it 'has the expected status code' do
expect(last_response.status).to eq(code)
end
it 'has a HAL+JSON Content-Type' do
expected_content_type = 'application/hal+json; charset=utf-8'
expect(last_response.headers).to include 'Content-Type'
expect(last_response.headers['Content-Type'].downcase).to eql expected_content_type
end
describe 'response body' do
subject { JSON.parse(last_response.body) }

Loading…
Cancel
Save