gds-api-adapters 18.7.0 → 18.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gds_api/support_api.rb +5 -0
- data/lib/gds_api/test_helpers/support_api.rb +7 -0
- data/lib/gds_api/version.rb +1 -1
- data/test/support_api_test.rb +16 -0
- 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: ea89fd438cbba6c673809179881a7bdbadd0e3dc
|
4
|
+
data.tar.gz: 208b3d3b4b5c4d9d9ba3d8bef0628c7c6a39ecff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: baed69aa1bf51bc65c263f0ced8c377fee6ba2d918b8e415299669f42f434bb3c32e182081396eb10a6cbfb4de9d8edc7411943f2280bea991656da57bea9d1a
|
7
|
+
data.tar.gz: f3505c6e0d17c9525f017ace7613f4660c64f9d5e10ced0655fe1a2754af3a185e3cf0ce6d638bf8cf31398b1a64a42fb3c9e77df3884759cb034bd91f266191
|
data/lib/gds_api/support_api.rb
CHANGED
@@ -17,4 +17,9 @@ class GdsApi::SupportApi < GdsApi::Base
|
|
17
17
|
date_string = date.strftime("%Y-%m-%d")
|
18
18
|
get_json!("#{endpoint}/anonymous-feedback/problem-reports/#{date_string}/totals")
|
19
19
|
end
|
20
|
+
|
21
|
+
def anonymous_feedback(options = {})
|
22
|
+
uri = "#{endpoint}/anonymous-feedback" + query_string(options)
|
23
|
+
get_json!(uri)
|
24
|
+
end
|
20
25
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'cgi'
|
1
2
|
require 'plek'
|
2
3
|
|
3
4
|
module GdsApi
|
@@ -34,6 +35,12 @@ module GdsApi
|
|
34
35
|
def support_api_isnt_available
|
35
36
|
stub_request(:post, /#{SUPPORT_API_ENDPOINT}\/.*/).to_return(:status => 503)
|
36
37
|
end
|
38
|
+
|
39
|
+
def stub_anonymous_feedback(params, response_body = {})
|
40
|
+
stub_http_request(:get, "#{SUPPORT_API_ENDPOINT}/anonymous-feedback").
|
41
|
+
with(query: params).
|
42
|
+
to_return(status: 200, body: response_body.to_json)
|
43
|
+
end
|
37
44
|
end
|
38
45
|
end
|
39
46
|
end
|
data/lib/gds_api/version.rb
CHANGED
data/test/support_api_test.rb
CHANGED
@@ -63,4 +63,20 @@ describe GdsApi::SupportApi do
|
|
63
63
|
|
64
64
|
assert_raises(GdsApi::HTTPServerError) { @api.create_service_feedback({}) }
|
65
65
|
end
|
66
|
+
|
67
|
+
describe "GET /anonymous-feedback" do
|
68
|
+
it "fetches anonymous feedback" do
|
69
|
+
stub_get = stub_anonymous_feedback(
|
70
|
+
path_prefix: "/vat-rates",
|
71
|
+
page: 55,
|
72
|
+
)
|
73
|
+
|
74
|
+
result = @api.anonymous_feedback(
|
75
|
+
path_prefix: "/vat-rates",
|
76
|
+
page: 55,
|
77
|
+
)
|
78
|
+
|
79
|
+
assert_requested(stub_get)
|
80
|
+
end
|
81
|
+
end
|
66
82
|
end
|
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: 18.
|
4
|
+
version: 18.8.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: 2015-05-
|
11
|
+
date: 2015-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: plek
|