Add tests for Content-Type returned from #create.
This commit is contained in:
parent
8d0f6699ae
commit
19ea9e8b6d
1 changed files with 10 additions and 0 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue