Skip to content

Commit 00b30e3

Browse files
maxnussbaumGERMAN ATTANASIO RUIZ
authored andcommitted
test(personality insights): Add more tests for personality insights
1 parent 738392e commit 00b30e3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/unit/test_personality_insights_v3.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)