gds-api-adapters 33.0.0 → 33.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 04272eb2b13ca787d551913892fd5fca3d6aa811
4
- data.tar.gz: 53c9ec99bddfe9aa595af6623f53aaee690fa3f4
3
+ metadata.gz: a7f9ef7bf8f91e52adc8dace6dd8a83c354241a2
4
+ data.tar.gz: bef2b694c6c916177cc89c64c8c472334785fe16
5
5
  SHA512:
6
- metadata.gz: 87036a6b8df55f5c7a4816d613c993d81e5eb62f37564a921c47e82eb4bb41a4eeb49718e104bb1a1108f773ac8682e8c443bf99779fcd36e84d74edf19f8b15
7
- data.tar.gz: 8ae4acdb7689c5405e5ff24d37b2420d7a240a5e1fd6c0501a9a3e65e73e602a0ba39f05d162c14b87e88e889388a57e658b1f0722568d26845b85f782239209
6
+ metadata.gz: 496fe45e9c5fb9c6eb2bebd9f2b74330facf5ab538ffc617a4aaef3205999671ad27722d9c55849f2f6a65cd0a0dbf9a40d9339b578dbcb9707f61782d75d272
7
+ data.tar.gz: 5a6b15ea7bd76ac302ae70f47843c76b1755c831c9bd90a7d6ea99800a8ff4724de63ac37defb659ec30490363cb213f6a61e8baa71c159042dbce458dd270f1
@@ -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")
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '33.0.0'
2
+ VERSION = '33.1.0'
3
3
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gds-api-adapters
3
3
  version: !ruby/object:Gem::Version
4
- version: 33.0.0
4
+ version: 33.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Stewart