gds-api-adapters 7.18.0 → 7.19.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.
- data/lib/gds_api/support.rb +2 -2
- data/lib/gds_api/test_helpers/support.rb +3 -3
- data/lib/gds_api/version.rb +1 -1
- data/test/support_api_test.rb +9 -11
- metadata +4 -4
data/lib/gds_api/support.rb
CHANGED
@@ -17,8 +17,8 @@ class GdsApi::Support < GdsApi::Base
|
|
17
17
|
post_json!("#{base_url}/anonymous_feedback/long_form_contacts", { :long_form_contact => request_details }, options[:headers] || {})
|
18
18
|
end
|
19
19
|
|
20
|
-
def
|
21
|
-
post_json!("#{base_url}/anonymous_feedback/
|
20
|
+
def create_service_feedback(request_details, options = {})
|
21
|
+
post_json!("#{base_url}/anonymous_feedback/service_feedback", { :service_feedback => request_details }, options[:headers] || {})
|
22
22
|
end
|
23
23
|
|
24
24
|
private
|
@@ -27,9 +27,9 @@ module GdsApi
|
|
27
27
|
post_stub.to_return(:status => 201)
|
28
28
|
end
|
29
29
|
|
30
|
-
def
|
31
|
-
post_stub = stub_http_request(:post, "#{SUPPORT_ENDPOINT}/anonymous_feedback/
|
32
|
-
post_stub.with(:body => {
|
30
|
+
def stub_support_service_feedback_creation(feedback_details = nil)
|
31
|
+
post_stub = stub_http_request(:post, "#{SUPPORT_ENDPOINT}/anonymous_feedback/service_feedback")
|
32
|
+
post_stub.with(:body => { service_feedback: feedback_details }) unless feedback_details.nil?
|
33
33
|
post_stub.to_return(:status => 201)
|
34
34
|
end
|
35
35
|
|
data/lib/gds_api/version.rb
CHANGED
data/test/support_api_test.rb
CHANGED
@@ -100,24 +100,24 @@ describe GdsApi::Support do
|
|
100
100
|
assert_raises(GdsApi::HTTPErrorResponse) { @api.create_problem_report({}) }
|
101
101
|
end
|
102
102
|
|
103
|
-
it "can pass
|
103
|
+
it "can pass service feedback" do
|
104
104
|
request_details = {"transaction-completed-values"=>"1", "details"=>"abc"}
|
105
105
|
|
106
|
-
stub_post = stub_request(:post, "#{@base_api_url}/anonymous_feedback/
|
107
|
-
with(:body => {"
|
106
|
+
stub_post = stub_request(:post, "#{@base_api_url}/anonymous_feedback/service_feedback").
|
107
|
+
with(:body => {"service_feedback" => request_details}.to_json).
|
108
108
|
to_return(:status => 201)
|
109
109
|
|
110
|
-
@api.
|
110
|
+
@api.create_service_feedback(request_details)
|
111
111
|
|
112
112
|
assert_requested(stub_post)
|
113
113
|
end
|
114
114
|
|
115
|
-
it "can add a custom header onto the
|
116
|
-
stub_request(:post, "#{@base_api_url}/anonymous_feedback/
|
115
|
+
it "can add a custom header onto the service feedback to the support app" do
|
116
|
+
stub_request(:post, "#{@base_api_url}/anonymous_feedback/service_feedback")
|
117
117
|
|
118
|
-
@api.
|
118
|
+
@api.create_service_feedback({}, headers: { "X-Varnish" => "12345"})
|
119
119
|
|
120
|
-
assert_requested(:post, %r{/
|
120
|
+
assert_requested(:post, %r{/service_feedback}) do |request|
|
121
121
|
request.headers["X-Varnish"] == "12345"
|
122
122
|
end
|
123
123
|
end
|
@@ -125,8 +125,6 @@ describe GdsApi::Support do
|
|
125
125
|
it "throws an exception when the support app isn't available" do
|
126
126
|
support_isnt_available
|
127
127
|
|
128
|
-
assert_raises(GdsApi::HTTPErrorResponse) { @api.
|
128
|
+
assert_raises(GdsApi::HTTPErrorResponse) { @api.create_service_feedback({}) }
|
129
129
|
end
|
130
|
-
|
131
|
-
|
132
130
|
end
|
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: 7.
|
4
|
+
version: 7.19.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-11-
|
12
|
+
date: 2013-11-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: plek
|
@@ -340,7 +340,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
340
340
|
version: '0'
|
341
341
|
segments:
|
342
342
|
- 0
|
343
|
-
hash:
|
343
|
+
hash: -2831006864257726038
|
344
344
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
345
345
|
none: false
|
346
346
|
requirements:
|
@@ -349,7 +349,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
349
349
|
version: '0'
|
350
350
|
segments:
|
351
351
|
- 0
|
352
|
-
hash:
|
352
|
+
hash: -2831006864257726038
|
353
353
|
requirements: []
|
354
354
|
rubyforge_project:
|
355
355
|
rubygems_version: 1.8.23
|