gds-api-adapters 14.8.0 → 14.9.0
Sign up to get free protection for your applications and to get access to all the features.
- 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 +12 -0
- metadata +42 -39
data/lib/gds_api/support_api.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
require_relative 'base'
|
2
2
|
|
3
3
|
class GdsApi::SupportApi < GdsApi::Base
|
4
|
+
def create_problem_report(request_details)
|
5
|
+
post_json!("#{endpoint}/anonymous-feedback/problem-reports", { :problem_report => request_details })
|
6
|
+
end
|
7
|
+
|
4
8
|
def create_service_feedback(request_details)
|
5
9
|
post_json!("#{endpoint}/anonymous-feedback/service-feedback", { :service_feedback => request_details })
|
6
10
|
end
|
@@ -5,6 +5,12 @@ module GdsApi
|
|
5
5
|
module SupportApi
|
6
6
|
SUPPORT_API_ENDPOINT = Plek.current.find('support-api')
|
7
7
|
|
8
|
+
def stub_support_api_problem_report_creation(request_details = nil)
|
9
|
+
post_stub = stub_http_request(:post, "#{SUPPORT_API_ENDPOINT}/anonymous-feedback/problem-reports")
|
10
|
+
post_stub.with(:body => { problem_report: request_details }) unless request_details.nil?
|
11
|
+
post_stub.to_return(:status => 202)
|
12
|
+
end
|
13
|
+
|
8
14
|
def stub_support_api_service_feedback_creation(feedback_details = nil)
|
9
15
|
post_stub = stub_http_request(:post, "#{SUPPORT_API_ENDPOINT}/anonymous-feedback/service-feedback")
|
10
16
|
post_stub.with(:body => { service_feedback: feedback_details }) unless feedback_details.nil?
|
data/lib/gds_api/version.rb
CHANGED
data/test/support_api_test.rb
CHANGED
@@ -10,6 +10,18 @@ describe GdsApi::SupportApi do
|
|
10
10
|
@api = GdsApi::SupportApi.new(@base_api_url)
|
11
11
|
end
|
12
12
|
|
13
|
+
it "can report a problem" do
|
14
|
+
request_details = {certain: "details"}
|
15
|
+
|
16
|
+
stub_post = stub_request(:post, "#{@base_api_url}/anonymous-feedback/problem-reports").
|
17
|
+
with(:body => {"problem_report" => request_details}.to_json).
|
18
|
+
to_return(:status => 201)
|
19
|
+
|
20
|
+
@api.create_problem_report(request_details)
|
21
|
+
|
22
|
+
assert_requested(stub_post)
|
23
|
+
end
|
24
|
+
|
13
25
|
it "can pass service feedback" do
|
14
26
|
request_details = {"transaction-completed-values"=>"1", "details"=>"abc"}
|
15
27
|
|
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: 14.
|
4
|
+
version: 14.9.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-10-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: plek
|
16
|
-
requirement: &
|
16
|
+
requirement: &16192660 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *16192660
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: null_logger
|
27
|
-
requirement: &
|
27
|
+
requirement: &16191900 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *16191900
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: link_header
|
38
|
-
requirement: &
|
38
|
+
requirement: &16190420 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *16190420
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: lrucache
|
49
|
-
requirement: &
|
49
|
+
requirement: &16188920 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 0.1.1
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *16188920
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rest-client
|
60
|
-
requirement: &
|
60
|
+
requirement: &16201420 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 1.6.3
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *16201420
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rack-cache
|
71
|
-
requirement: &
|
71
|
+
requirement: &16198200 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *16198200
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: rdoc
|
82
|
-
requirement: &
|
82
|
+
requirement: &16195560 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - =
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '3.12'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *16195560
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: rake
|
93
|
-
requirement: &
|
93
|
+
requirement: &16235380 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ~>
|
@@ -98,21 +98,24 @@ dependencies:
|
|
98
98
|
version: 0.9.2.2
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *16235380
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: webmock
|
104
|
-
requirement: &
|
104
|
+
requirement: &16232840 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
|
-
- -
|
107
|
+
- - ! '>='
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: '1.8'
|
110
|
+
- - <=
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: 1.18.0
|
110
113
|
type: :development
|
111
114
|
prerelease: false
|
112
|
-
version_requirements: *
|
115
|
+
version_requirements: *16232840
|
113
116
|
- !ruby/object:Gem::Dependency
|
114
117
|
name: mocha
|
115
|
-
requirement: &
|
118
|
+
requirement: &16260140 !ruby/object:Gem::Requirement
|
116
119
|
none: false
|
117
120
|
requirements:
|
118
121
|
- - ~>
|
@@ -120,10 +123,10 @@ dependencies:
|
|
120
123
|
version: 0.12.4
|
121
124
|
type: :development
|
122
125
|
prerelease: false
|
123
|
-
version_requirements: *
|
126
|
+
version_requirements: *16260140
|
124
127
|
- !ruby/object:Gem::Dependency
|
125
128
|
name: minitest
|
126
|
-
requirement: &
|
129
|
+
requirement: &16259300 !ruby/object:Gem::Requirement
|
127
130
|
none: false
|
128
131
|
requirements:
|
129
132
|
- - ~>
|
@@ -131,10 +134,10 @@ dependencies:
|
|
131
134
|
version: 3.4.0
|
132
135
|
type: :development
|
133
136
|
prerelease: false
|
134
|
-
version_requirements: *
|
137
|
+
version_requirements: *16259300
|
135
138
|
- !ruby/object:Gem::Dependency
|
136
139
|
name: rack
|
137
|
-
requirement: &
|
140
|
+
requirement: &16258420 !ruby/object:Gem::Requirement
|
138
141
|
none: false
|
139
142
|
requirements:
|
140
143
|
- - ! '>='
|
@@ -142,10 +145,10 @@ dependencies:
|
|
142
145
|
version: '0'
|
143
146
|
type: :development
|
144
147
|
prerelease: false
|
145
|
-
version_requirements: *
|
148
|
+
version_requirements: *16258420
|
146
149
|
- !ruby/object:Gem::Dependency
|
147
150
|
name: rack-test
|
148
|
-
requirement: &
|
151
|
+
requirement: &16257280 !ruby/object:Gem::Requirement
|
149
152
|
none: false
|
150
153
|
requirements:
|
151
154
|
- - ! '>='
|
@@ -153,10 +156,10 @@ dependencies:
|
|
153
156
|
version: '0'
|
154
157
|
type: :development
|
155
158
|
prerelease: false
|
156
|
-
version_requirements: *
|
159
|
+
version_requirements: *16257280
|
157
160
|
- !ruby/object:Gem::Dependency
|
158
161
|
name: simplecov
|
159
|
-
requirement: &
|
162
|
+
requirement: &16256560 !ruby/object:Gem::Requirement
|
160
163
|
none: false
|
161
164
|
requirements:
|
162
165
|
- - ~>
|
@@ -164,10 +167,10 @@ dependencies:
|
|
164
167
|
version: 0.5.4
|
165
168
|
type: :development
|
166
169
|
prerelease: false
|
167
|
-
version_requirements: *
|
170
|
+
version_requirements: *16256560
|
168
171
|
- !ruby/object:Gem::Dependency
|
169
172
|
name: simplecov-rcov
|
170
|
-
requirement: &
|
173
|
+
requirement: &16255920 !ruby/object:Gem::Requirement
|
171
174
|
none: false
|
172
175
|
requirements:
|
173
176
|
- - ! '>='
|
@@ -175,10 +178,10 @@ dependencies:
|
|
175
178
|
version: '0'
|
176
179
|
type: :development
|
177
180
|
prerelease: false
|
178
|
-
version_requirements: *
|
181
|
+
version_requirements: *16255920
|
179
182
|
- !ruby/object:Gem::Dependency
|
180
183
|
name: gem_publisher
|
181
|
-
requirement: &
|
184
|
+
requirement: &16269420 !ruby/object:Gem::Requirement
|
182
185
|
none: false
|
183
186
|
requirements:
|
184
187
|
- - ~>
|
@@ -186,10 +189,10 @@ dependencies:
|
|
186
189
|
version: 1.1.1
|
187
190
|
type: :development
|
188
191
|
prerelease: false
|
189
|
-
version_requirements: *
|
192
|
+
version_requirements: *16269420
|
190
193
|
- !ruby/object:Gem::Dependency
|
191
194
|
name: timecop
|
192
|
-
requirement: &
|
195
|
+
requirement: &16267840 !ruby/object:Gem::Requirement
|
193
196
|
none: false
|
194
197
|
requirements:
|
195
198
|
- - ~>
|
@@ -197,7 +200,7 @@ dependencies:
|
|
197
200
|
version: 0.5.1
|
198
201
|
type: :development
|
199
202
|
prerelease: false
|
200
|
-
version_requirements: *
|
203
|
+
version_requirements: *16267840
|
201
204
|
description: A set of adapters providing easy access to the GDS GOV.UK APIs
|
202
205
|
email:
|
203
206
|
- jystewart@gmail.com
|
@@ -328,7 +331,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
328
331
|
version: '0'
|
329
332
|
segments:
|
330
333
|
- 0
|
331
|
-
hash:
|
334
|
+
hash: 1622028299170972729
|
332
335
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
333
336
|
none: false
|
334
337
|
requirements:
|
@@ -337,7 +340,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
337
340
|
version: '0'
|
338
341
|
segments:
|
339
342
|
- 0
|
340
|
-
hash:
|
343
|
+
hash: 1622028299170972729
|
341
344
|
requirements: []
|
342
345
|
rubyforge_project:
|
343
346
|
rubygems_version: 1.8.11
|