gds-api-adapters 33.0.0 → 33.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/lib/gds_api/support_api.rb +4 -0
- data/lib/gds_api/test_helpers/support_api.rb +6 -0
- data/lib/gds_api/version.rb +1 -1
- data/test/support_api_test.rb +10 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7f9ef7bf8f91e52adc8dace6dd8a83c354241a2
|
4
|
+
data.tar.gz: bef2b694c6c916177cc89c64c8c472334785fe16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 496fe45e9c5fb9c6eb2bebd9f2b74330facf5ab538ffc617a4aaef3205999671ad27722d9c55849f2f6a65cd0a0dbf9a40d9339b578dbcb9707f61782d75d272
|
7
|
+
data.tar.gz: 5a6b15ea7bd76ac302ae70f47843c76b1755c831c9bd90a7d6ea99800a8ff4724de63ac37defb659ec30490363cb213f6a61e8baa71c159042dbce458dd270f1
|
data/lib/gds_api/support_api.rb
CHANGED
@@ -17,6 +17,10 @@ class GdsApi::SupportApi < GdsApi::Base
|
|
17
17
|
post_json!("#{endpoint}/anonymous-feedback/export-requests", export_request: request_details)
|
18
18
|
end
|
19
19
|
|
20
|
+
def create_global_export_request(request_details)
|
21
|
+
post_json!("#{endpoint}/anonymous-feedback/global-export-requests", global_export_request: request_details)
|
22
|
+
end
|
23
|
+
|
20
24
|
def problem_report_daily_totals_for(date)
|
21
25
|
date_string = date.strftime("%Y-%m-%d")
|
22
26
|
get_json!("#{endpoint}/anonymous-feedback/problem-reports/#{date_string}/totals")
|
@@ -30,6 +30,12 @@ module GdsApi
|
|
30
30
|
post_stub.to_return(:status => 202)
|
31
31
|
end
|
32
32
|
|
33
|
+
def stub_support_global_export_request_creation(request_details = nil)
|
34
|
+
post_stub = stub_http_request(:post, "#{SUPPORT_API_ENDPOINT}/anonymous-feedback/global-export-requests")
|
35
|
+
post_stub.with(:body => { global_export_request: request_details }) unless request_details.nil?
|
36
|
+
post_stub.to_return(:status => 202)
|
37
|
+
end
|
38
|
+
|
33
39
|
def stub_problem_report_daily_totals_for(date, expected_results = nil)
|
34
40
|
date_string = date.strftime("%Y-%m-%d")
|
35
41
|
get_stub = stub_http_request(:get, "#{SUPPORT_API_ENDPOINT}/anonymous-feedback/problem-reports/#{date_string}/totals")
|
data/lib/gds_api/version.rb
CHANGED
data/test/support_api_test.rb
CHANGED
@@ -112,6 +112,16 @@ describe GdsApi::SupportApi do
|
|
112
112
|
assert_requested(stub_post)
|
113
113
|
end
|
114
114
|
end
|
115
|
+
|
116
|
+
describe "POST /anonymous-feedback/global-export-requests" do
|
117
|
+
it "makes a POST request to the support API" do
|
118
|
+
params = {from_date: "1 June 2016", to_date: "8 June 2016", notification_email: "foo@example.com"}
|
119
|
+
stub_post = stub_support_global_export_request_creation(params)
|
120
|
+
|
121
|
+
@api.create_global_export_request(params)
|
122
|
+
assert_requested(stub_post)
|
123
|
+
end
|
124
|
+
end
|
115
125
|
|
116
126
|
describe "GET /anonymous-feedback/export-requests/:id" do
|
117
127
|
it "fetches the export request details from the API" do
|