gds-api-adapters 50.0.0 → 50.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +0 -1
- data/lib/gds_api/email_alert_api.rb +9 -0
- data/lib/gds_api/test_helpers/email_alert_api.rb +20 -0
- data/lib/gds_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98ec915f6369ff655de325f9034f06daf1d2570e
|
4
|
+
data.tar.gz: 24ca88c29d87f9f9652e796c78cbd77fc86169f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ea06116f28db8c79be9c77be92fbacaf5b8272974a0edace5f13c99acef21308991f7495f94ff6f2569656c1fb831e72dd6afce49843a11cf4af7a5194ad393
|
7
|
+
data.tar.gz: b6e238e353b4c4b29a14fafbccdbc27a6991ff290dd148eea73582ee65b31f070a1a780757ed600ab97667dab7228b9b6b147c334eb4e0deb0182915a3c3e325
|
data/Rakefile
CHANGED
@@ -88,6 +88,15 @@ class GdsApi::EmailAlertApi < GdsApi::Base
|
|
88
88
|
get_json("#{endpoint}/topic-matches.json?#{query_string}")
|
89
89
|
end
|
90
90
|
|
91
|
+
# Unsubscribe
|
92
|
+
# #
|
93
|
+
# @param uuid Subscription uuid
|
94
|
+
#
|
95
|
+
# @return [Hash] deleted
|
96
|
+
def unsubscribe(uuid)
|
97
|
+
post_json("#{endpoint}/unsubscribe/#{uuid}")
|
98
|
+
end
|
99
|
+
|
91
100
|
private
|
92
101
|
|
93
102
|
def nested_query_string(params)
|
@@ -93,6 +93,22 @@ module GdsApi
|
|
93
93
|
)
|
94
94
|
end
|
95
95
|
|
96
|
+
def email_alert_api_unsubscribes_a_subscription(uuid)
|
97
|
+
stub_request(:post, unsubscribe_url(uuid))
|
98
|
+
.with(body: "{}")
|
99
|
+
.to_return(status: 204)
|
100
|
+
end
|
101
|
+
|
102
|
+
def email_alert_api_has_no_subscription_for_uuid(uuid)
|
103
|
+
stub_request(:post, unsubscribe_url(uuid))
|
104
|
+
.with(body: "{}")
|
105
|
+
.to_return(status: 404)
|
106
|
+
end
|
107
|
+
|
108
|
+
def assert_unsubscribed(uuid)
|
109
|
+
assert_requested(:post, unsubscribe_url(uuid), times: 1)
|
110
|
+
end
|
111
|
+
|
96
112
|
private
|
97
113
|
|
98
114
|
def subscriber_lists_url(attributes = nil)
|
@@ -122,6 +138,10 @@ module GdsApi
|
|
122
138
|
def notifications_url
|
123
139
|
EMAIL_ALERT_API_ENDPOINT + "/notifications"
|
124
140
|
end
|
141
|
+
|
142
|
+
def unsubscribe_url(uuid)
|
143
|
+
EMAIL_ALERT_API_ENDPOINT + "/unsubscribe/#{uuid}"
|
144
|
+
end
|
125
145
|
end
|
126
146
|
end
|
127
147
|
end
|
data/lib/gds_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gds-api-adapters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 50.
|
4
|
+
version: 50.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Stewart
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: plek
|