gds-api-adapters 8.3.0 → 8.3.1

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.
@@ -4,7 +4,7 @@ module GdsApi
4
4
  module PerformancePlatform
5
5
  class DataIn < GdsApi::Base
6
6
  def submit_service_feedback_day_aggregate(slug, request_details)
7
- post_json!("#{endpoint}/#{slug}_customer_satisfaction", request_details)
7
+ post_json!("#{endpoint}/#{slug.gsub("-", "_")}_customer_satisfaction", request_details)
8
8
  end
9
9
  end
10
10
  end
@@ -5,18 +5,23 @@ module GdsApi
5
5
  PP_DATA_IN_ENDPOINT = "http://www.performance.dev.gov.uk"
6
6
 
7
7
  def stub_service_feedback_day_aggregate_submission(slug, request_body = nil)
8
- post_stub = stub_http_request(:post, "#{PP_DATA_IN_ENDPOINT}/#{slug}_customer_satisfaction")
8
+ post_stub = stub_http_request(:post, "#{PP_DATA_IN_ENDPOINT}/#{adjusted(slug)}_customer_satisfaction")
9
9
  post_stub.with(body: request_body) unless request_body.nil?
10
10
  post_stub.to_return(:status => 200)
11
11
  end
12
12
 
13
13
  def stub_service_feedback_bucket_unavailable_for(slug)
14
- stub_request(:post, "#{PP_DATA_IN_ENDPOINT}/#{slug}_customer_satisfaction").to_return(:status => 404)
14
+ stub_request(:post, "#{PP_DATA_IN_ENDPOINT}/#{adjusted(slug)}_customer_satisfaction").to_return(:status => 404)
15
15
  end
16
16
 
17
17
  def stub_pp_isnt_available
18
18
  stub_request(:post, /#{PP_DATA_IN_ENDPOINT}\/.*/).to_return(:status => 503)
19
19
  end
20
+
21
+ private
22
+ def adjusted(slug)
23
+ slug.gsub("-", "_")
24
+ end
20
25
  end
21
26
  end
22
27
  end
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '8.3.0'
2
+ VERSION = '8.3.1'
3
3
  end
@@ -13,9 +13,9 @@ describe GdsApi::PerformancePlatform::DataIn do
13
13
  it "can submit a day aggregate for service feedback for a particular slug" do
14
14
  request_details = {"some"=> "data"}
15
15
 
16
- stub_post = stub_service_feedback_day_aggregate_submission("some_slug", request_details)
16
+ stub_post = stub_service_feedback_day_aggregate_submission("some-slug", request_details)
17
17
 
18
- @api.submit_service_feedback_day_aggregate("some_slug", request_details)
18
+ @api.submit_service_feedback_day_aggregate("some-slug", request_details)
19
19
 
20
20
  assert_requested(stub_post)
21
21
  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: 8.3.0
4
+ version: 8.3.1
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: 2014-01-27 00:00:00.000000000 Z
12
+ date: 2014-02-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: plek
@@ -367,7 +367,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
367
367
  version: '0'
368
368
  segments:
369
369
  - 0
370
- hash: -354225401793444453
370
+ hash: -1298841985132327871
371
371
  required_rubygems_version: !ruby/object:Gem::Requirement
372
372
  none: false
373
373
  requirements:
@@ -376,7 +376,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
376
376
  version: '0'
377
377
  segments:
378
378
  - 0
379
- hash: -354225401793444453
379
+ hash: -1298841985132327871
380
380
  requirements: []
381
381
  rubyforge_project:
382
382
  rubygems_version: 1.8.23