summaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
authorGibheer <gibheer@gmail.com>2012-11-13 21:57:40 +0100
committerGibheer <gibheer@gmail.com>2012-11-13 21:57:40 +0100
commit0a81098061e8a2d6312067ccc435d0748d93b2bc (patch)
tree001646c33b428825c8240e98fb07ef15c2f9a20e /spec/unit
parentd9c22d2103513bea442230aaddff93da30bc13d8 (diff)
added specs for #content_type
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/request/content_type_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/unit/request/content_type_spec.rb b/spec/unit/request/content_type_spec.rb
new file mode 100644
index 0000000..7482ccc
--- /dev/null
+++ b/spec/unit/request/content_type_spec.rb
@@ -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