Add tests for Content-Type returned from #create.

This commit is contained in:
John Edmonds 2011-10-01 11:48:41 -04:00
parent 8d0f6699ae
commit 19ea9e8b6d

View file

@ -24,6 +24,16 @@ describe PhotosController do
post :create, @params post :create, @params
}.should change(Photo, :count).by(1) }.should change(Photo, :count).by(1)
end end
it 'returns application/json when possible' do
request.env['HTTP_ACCEPT'] = 'application/json'
post(:create, @params).headers['Content-Type'].should match 'application/json.*'
end
it 'returns text/html by default' do
request.env['HTTP_ACCEPT'] = 'text/html,*/*'
post(:create, @params).headers['Content-Type'].should match 'text/html.*'
end
end end
describe '#create' do describe '#create' do