Skip to content

Commit c378204

Browse files
maxnussbaumGERMAN ATTANASIO RUIZ
authored andcommitted
test(assistant): Add more tests for assistant
1 parent a7c0220 commit c378204

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/unit/test_assistant_v1.rb

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def test_rate_limit_exceeded
7373
rescue WatsonApiException => e
7474
assert_equal(error_code, e.code)
7575
assert_equal(error_msg, e.error)
76+
assert(e.to_s.instance_of?(String))
7677
end
7778
end
7879

@@ -1570,4 +1571,28 @@ def test_delete_user_data
15701571
)
15711572
assert(service_response.nil?)
15721573
end
1574+
1575+
def test_update_dialog_node
1576+
service = WatsonAPIs::AssistantV1.new(
1577+
username: "username",
1578+
password: "password",
1579+
version: "2018-02-16"
1580+
)
1581+
stub_request(:post, "https://gateway.watsonplatform.net/assistant/api/v1/workspaces/workspace_id/dialog_nodes/dialog_node?version=2018-02-16")
1582+
.with(
1583+
body: "{\"description\":\"A new description\"}",
1584+
headers: {
1585+
"Accept" => "application/json",
1586+
"Authorization" => "Basic dXNlcm5hbWU6cGFzc3dvcmQ=",
1587+
"Content-Type" => "application/json",
1588+
"Host" => "gateway.watsonplatform.net"
1589+
}
1590+
).to_return(status: 200, body: "Pseudo update dialog node response", headers: {})
1591+
service_response = service.update_dialog_node(
1592+
workspace_id: "workspace_id",
1593+
dialog_node: "dialog_node",
1594+
new_description: "A new description"
1595+
)
1596+
assert_equal("Pseudo update dialog node response", service_response.body)
1597+
end
15731598
end

0 commit comments

Comments
 (0)