-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test for GdsApi::EmailAlertApi#get_subscriber_list_metrics
- Loading branch information
1 parent
45c8313
commit ac80426
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -549,6 +549,28 @@ | |
end | ||
end | ||
|
||
describe "get_subscribe_list_metrics" do | ||
it "returns the parsed json" do | ||
stub_get_subscriber_list_metrics(path: "/the/path", response: { | ||
subscriber_list_count: 5, | ||
all_notify_count: 12, | ||
}.to_json) | ||
|
||
api_response = api_client.get_subscriber_list_metrics(path: "/the/path") | ||
assert_equal(200, api_response.code) | ||
parsed_body = api_response.to_h | ||
assert_equal({ "subscriber_list_count" => 5, "all_notify_count" => 12 }, parsed_body) | ||
end | ||
|
||
it "raises 404 when not found" do | ||
stub_get_subscriber_list_metrics_not_found(path: "/the/path") | ||
|
||
assert_raises GdsApi::HTTPNotFound do | ||
api_client.get_subscriber_list_metrics(path: "/the/path") | ||
end | ||
end | ||
end | ||
|
||
describe "change_subscriber with an id that needs URI encoding" do | ||
it "encodes the id" do | ||
request = stub_email_alert_api_has_updated_subscriber("string%20id", "[email protected]") | ||
|