0
0
Fork 0

added specs for #content_type

This commit is contained in:
Gibheer 2012-11-13 21:57:40 +01:00
parent d9c22d2103
commit 0a81098061
1 changed files with 16 additions and 0 deletions

View File

@ -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