Skip to content

Commit bc101e5

Browse files
author
Jeff Utter
committed
Unit test for Content-Type header
1 parent 72d7565 commit bc101e5

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

spec/headers_spec.rb

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
require 'spec_helper'
2+
3+
class FakeHeaderable
4+
include RspecApiDocumentation::Headers
5+
6+
def public_env_to_headers(env)
7+
env_to_headers(env)
8+
end
9+
end
10+
11+
describe RspecApiDocumentation::Headers do
12+
let(:example) { FakeHeaderable.new }
13+
14+
describe '#env_to_headers' do
15+
subject { example.public_env_to_headers(env) }
16+
17+
context 'When the env contains "CONTENT_TYPE"' do
18+
let(:env) { { "CONTENT_TYPE" => 'multipart/form-data' } }
19+
20+
it 'converts the header to "Content-Type"' do
21+
expect(subject['Content-Type']).to eq 'multipart/form-data'
22+
end
23+
end
24+
end
25+
26+
end

0 commit comments

Comments
 (0)