added specs for #content_type
This commit is contained in:
parent
d9c22d2103
commit
0a81098061
|
@ -0,0 +1,16 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Zero::Request, '#content_type' do
|
||||
subject { Zero::Request.new(env) }
|
||||
|
||||
context 'returns nil with no content type' do
|
||||
let(:env) { EnvGenerator.get('/foo') }
|
||||
its('content_type') { should be(nil) }
|
||||
end
|
||||
|
||||
context 'returns the set content type' do
|
||||
let(:content_type) { 'bogus/type' }
|
||||
let(:env) { EnvGenerator.post('/foo', {'CONTENT_TYPE' => content_type}) }
|
||||
its('content_type') { should be(content_type) }
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue