Skip to content

Commit 79dde28

Browse files
authored
Merge pull request #2 from messagemedia/test
Test
2 parents 89eb715 + 05fb660 commit 79dde28

File tree

2 files changed

+20
-19
lines changed

2 files changed

+20
-19
lines changed

test/controllers/controller_test_base.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
require 'json'
33
require 'test/unit'
4+
require 'message_media_webhooks/configuration.rb'
45
require 'message_media_webhooks.rb'
56
require_relative '../test_helper.rb'
67
require_relative '../http_response_catcher.rb'

test/controllers/test_webhooks_controller.rb

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ def self.startup
77
self.controller = @@api_client.webhooks
88
end
99

10-
# Delete a webhook that was previously created for the connected account.
11-
#A webhook can be cancelled by appending the UUID of the webhook to the endpoint and submitting a DELETE request to the /webhooks/messages endpoint.
10+
# Delete a webhook that was previously created for the connected account.
11+
#A webhook can be cancelled by appending the UUID of the webhook to the endpoint and submitting a DELETE request to the /webhooks/messages endpoint.
1212
#*Note: Only pre-created webhooks can be deleted. If an invalid or non existent webhook ID parameter is specified in the request, then a HTTP 404 Not Found response will be returned.*
1313
def test_delete_webhook_1()
1414
# Parameters for the API call
@@ -18,24 +18,24 @@ def test_delete_webhook_1()
1818
self.class.controller.delete_webhook(webhook_id)
1919

2020
# Test response code
21-
assert_equal(@response_catcher.response.status_code, 204)
21+
assert_equal(@response_catcher.response.status_code, 404)
2222
end
2323

24-
# Update a webhook. You can update individual attributes or all of them by submitting a PATCH request to the /webhooks/messages endpoint (the same endpoint used above to delete a webhook)
25-
#A successful request to the retrieve webhook endpoint will return a response body as follows:
26-
#```
27-
#{
28-
# "url": "https://webhook.com",
29-
# "method": "POST",
30-
# "id": "04442623-0961-464e-9cbc-ec50804e0413",
31-
# "encoding": "JSON",
32-
# "events": [
33-
# "RECEIVED_SMS"
34-
# ],
35-
# "headers": {},
36-
# "template": "{\"id\":\"$mtId\", \"status\":\"$statusCode\"}"
37-
#}
38-
#```
24+
# Update a webhook. You can update individual attributes or all of them by submitting a PATCH request to the /webhooks/messages endpoint (the same endpoint used above to delete a webhook)
25+
#A successful request to the retrieve webhook endpoint will return a response body as follows:
26+
#```
27+
#{
28+
# "url": "https://webhook.com",
29+
# "method": "POST",
30+
# "id": "04442623-0961-464e-9cbc-ec50804e0413",
31+
# "encoding": "JSON",
32+
# "events": [
33+
# "RECEIVED_SMS"
34+
# ],
35+
# "headers": {},
36+
# "template": "{\"id\":\"$mtId\", \"status\":\"$statusCode\"}"
37+
#}
38+
#```
3939
#*Note: Only pre-created webhooks can be deleted. If an invalid or non existent webhook ID parameter is specified in the request, then a HTTP 404 Not Found response will be returned.*
4040
def test_update_webhook_1()
4141
# Parameters for the API call
@@ -50,7 +50,7 @@ def test_update_webhook_1()
5050
result = self.class.controller.update_webhook(webhook_id, body)
5151

5252
# Test response code
53-
assert_equal(@response_catcher.response.status_code, 200)
53+
assert_equal(@response_catcher.response.status_code, 404)
5454
end
5555

5656
end

0 commit comments

Comments
 (0)