File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,22 @@ def test_plain_to_json
4040 assert ( service_response . headers . key? ( key ) )
4141 assert ( expected_response . headers [ key ] == service_response . headers [ key ] )
4242 end
43+
44+ stub_request ( :post , "https://gateway.watsonplatform.net/personality-insights/api/v3/profile?version=2017-10-13" )
45+ . with (
46+ body : { "personality" => "text" } . to_json ,
47+ headers : {
48+ "Accept" => "application/json" ,
49+ "Authorization" => "Basic dXNlcm5hbWU6cGFzc3dvcmQ=" ,
50+ "Content-Type" => "application/json" ,
51+ "Host" => "gateway.watsonplatform.net"
52+ }
53+ ) . to_return ( status : 200 , body : { "profile" => "response" } . to_json , headers : headers )
54+ service_response = service . profile (
55+ content : { "personality" => "text" } ,
56+ content_type : "application/json"
57+ )
58+ assert_equal ( { "profile" => "response" } , service_response . body )
4359 end
4460
4561 def test_json_to_json
You can’t perform that action at this time.
0 commit comments