We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e0deeca commit fa3f5d1Copy full SHA for fa3f5d1
spec/bitbucket_rest_api/request/jsonize_spec.rb
@@ -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
19
+end
0 commit comments