gds-api-adapters 7.18.0 → 7.19.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 create_transactions(request_details, options = {})
21
- post_json!("#{base_url}/anonymous_feedback/transactions", { :transactions => request_details }, options[:headers] || {})
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 stub_support_transactions_creation(request_details = nil)
31
- post_stub = stub_http_request(:post, "#{SUPPORT_ENDPOINT}/anonymous_feedback/transactions")
32
- post_stub.with(:body => {"transactions" => request_details}) unless request_details.nil?
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
 
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '7.18.0'
2
+ VERSION = '7.19.0'
3
3
  end
@@ -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 transaction feedback" do
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/transactions").
107
- with(:body => {"transactions" => request_details}.to_json).
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.create_transactions(request_details)
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 transaction feedback to the support app" do
116
- stub_request(:post, "#{@base_api_url}/anonymous_feedback/transactions")
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.create_transactions({}, headers: { "X-Varnish" => "12345"})
118
+ @api.create_service_feedback({}, headers: { "X-Varnish" => "12345"})
119
119
 
120
- assert_requested(:post, %r{/transactions}) do |request|
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.create_transactions({}) }
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.18.0
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-04 00:00:00.000000000 Z
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: 471718950989814646
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: 471718950989814646
352
+ hash: -2831006864257726038
353
353
  requirements: []
354
354
  rubyforge_project:
355
355
  rubygems_version: 1.8.23