Skip to content

Commit bded318

Browse files
authored
Merge pull request #67 from github/pvfs-check-fields
Check for fields and provide error desc
2 parents f6f1557 + 78b3a76 commit bded318

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/chatops/controller/test_case_helpers.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def chatop(method, params = {})
4242
def chat(message, user, room_id = "123", message_id = "456")
4343
get :list
4444
json_response = JSON.load(response.body)
45+
raise "Invalid Chatop response - BODY: #{json_response}" unless json_response.key?("methods")
4546
matchers = json_response["methods"].map { |name, metadata|
4647
metadata = metadata.dup
4748
metadata["name"] = name
@@ -75,6 +76,7 @@ def chatop_response
7576

7677
def chatop_error
7778
json_response = JSON.load(response.body)
79+
raise "There is no chatop error - BODY: #{json_response}" unless json_response.key?("error")
7880
json_response["error"]["message"]
7981
end
8082

0 commit comments

Comments
 (0)