0
0
zero/spec/unit/request/content_type_spec.rb
2012-11-13 21:57:40 +01:00

17 lines
469 B
Ruby

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