Skip to content

Commit fa3f5d1

Browse files
committed
Add request/jsonize_spec
1 parent e0deeca commit fa3f5d1

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
require 'spec_helper'
2+
3+
describe BitBucket::Request::Jsonize do
4+
let(:jsonize) { described_class.new }
5+
before do
6+
@jsonize = BitBucket::Request::Jsonize.new(lambda { |env| env })
7+
@env = {
8+
body: {key1: 'val1'},
9+
request_headers: {
10+
'Content-Type' => 'application/json; charset=utf-8'
11+
}
12+
}
13+
end
14+
15+
it "converts the body to json" do
16+
expected = {body: "{\"key1\":\"val1\"}", request_headers: {"Content-Type"=>"application/json; charset=utf-8"}}
17+
expect(@jsonize.call(@env)).to eq expected
18+
end
19+
end

0 commit comments

Comments
 (0)