gds-api-adapters 47.9.1 → 48.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 013202e25f39bc1b67d951ce84c5c7ffb998fd05
4
- data.tar.gz: 690569f39649f72763b63f0d2a1ad5a99f27dbe1
3
+ metadata.gz: e3fef7af19662563a6043ef90158471079b7deca
4
+ data.tar.gz: 9872c16f885853d14249d733c6c59fac73338bb1
5
5
  SHA512:
6
- metadata.gz: 857bb495dbf9d0080053f437aebbcb51bbfdc4843aafae2e57963436a70ec53fe26a8e7e86fcb0bc711f9ed721e5807314c6ac7bf4b66b6a99f5362dab8825f1
7
- data.tar.gz: 13680c1f52e0eb295f116ba99711cac327d217a82fc1f3146e6a656384382f274a036b9c9065f600cb3a5185c5b560cb4f12edab1a48b4d006fa63951b0e3348
6
+ metadata.gz: 8c03fee24ac79191be81310a96f6f8a8e6b50a4b1314ef036162a0464e85c719205da48298cd4823df600070303a4072d75b64c26de7e923285aaf3c533c7ef6
7
+ data.tar.gz: 355939f04694c309530da78106255e81f31b638e8c7fa45aded79bd9edae46e9781e60155437bfeccb5817bacd6c0afbbeeef69f790104d3006cd9a42c0b900f
@@ -2,7 +2,6 @@ require 'gds_api/asset_manager'
2
2
  require 'gds_api/content_store'
3
3
  require 'gds_api/imminence'
4
4
  require 'gds_api/licence_application'
5
- require 'gds_api/need_api'
6
5
  require 'gds_api/worldwide'
7
6
  require 'gds_api/email_alert_api'
8
7
 
@@ -24,10 +23,6 @@ module GdsApi
24
23
  @licence_application_api ||= GdsApi::LicenceApplication.new(Plek.current.find("licensify"), options)
25
24
  end
26
25
 
27
- def need_api(options = {})
28
- @need_api ||= GdsApi::NeedApi.new(Plek.current.find("needapi"), options)
29
- end
30
-
31
26
  def worldwide_api(options = {})
32
27
  @worldwide_api ||= GdsApi::Worldwide.new(Plek.current.find("whitehall-admin"), options)
33
28
  end
@@ -9,6 +9,10 @@ class GdsApi::Support < GdsApi::Base
9
9
  post_json("#{base_url}/named_contacts", named_contact: request_details)
10
10
  end
11
11
 
12
+ def feedback_url(slug)
13
+ "#{base_url}/anonymous_feedback?path=#{slug}"
14
+ end
15
+
12
16
  private
13
17
 
14
18
  def base_url
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '47.9.1'.freeze
2
+ VERSION = '48.0.0'.freeze
3
3
  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: 47.9.1
4
+ version: 48.0.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: 2017-09-04 00:00:00.000000000 Z
11
+ date: 2017-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: plek
@@ -402,7 +402,6 @@ files:
402
402
  - lib/gds_api/test_helpers/link_checker_api.rb
403
403
  - lib/gds_api/test_helpers/local_links_manager.rb
404
404
  - lib/gds_api/test_helpers/mapit.rb
405
- - lib/gds_api/test_helpers/need_api.rb
406
405
  - lib/gds_api/test_helpers/organisations.rb
407
406
  - lib/gds_api/test_helpers/performance_platform/data_in.rb
408
407
  - lib/gds_api/test_helpers/performance_platform/data_out.rb
@@ -1,90 +0,0 @@
1
- require 'gds_api/test_helpers/json_client_helper'
2
- require 'gds_api/test_helpers/common_responses'
3
-
4
- module GdsApi
5
- module TestHelpers
6
- module NeedApi
7
- include GdsApi::TestHelpers::CommonResponses
8
-
9
- NEED_API_ENDPOINT = Plek.current.find('need-api')
10
-
11
- def need_api_has_needs_for_organisation(organisation, needs)
12
- url = NEED_API_ENDPOINT + "/needs?organisation_id=#{organisation}"
13
-
14
- body = response_base.merge(
15
- "results" => needs
16
- )
17
- stub_request(:get, url).to_return(status: 200, body: body.to_json, headers: {})
18
- end
19
-
20
- def need_api_has_needs_for_search(search_term, needs)
21
- url = NEED_API_ENDPOINT + "/needs?q=#{search_term}"
22
-
23
- body = response_base.merge(
24
- "results" => needs
25
- )
26
- stub_request(:get, url).to_return(status: 200, body: body.to_json, headers: {})
27
- end
28
-
29
- def need_api_has_needs(needs)
30
- url = NEED_API_ENDPOINT + "/needs"
31
-
32
- body = response_base.merge(
33
- "results" => needs
34
- )
35
- stub_request(:get, url).to_return(status: 200, body: body.to_json, headers: {})
36
- end
37
-
38
- def need_api_has_need_ids(needs)
39
- ids = needs.map { |need| (need["id"] || need[:id]).to_i }.sort.join(',')
40
- url = NEED_API_ENDPOINT + "/needs?ids=#{ids}"
41
-
42
- body = response_base.merge(
43
- "results" => needs
44
- )
45
- stub_request(:get, url).to_return(status: 200, body: body.to_json, headers: {})
46
- end
47
-
48
- def need_api_has_need(need)
49
- need_id = need["id"] || need[:id]
50
- raise ArgumentError, "Test need is missing an ID" unless need_id
51
-
52
- url = NEED_API_ENDPOINT + "/needs/#{need_id}"
53
- stub_request(:get, url).to_return(status: 200, body: need.to_json, headers: {})
54
- end
55
-
56
- def need_api_has_content_id_for_need(need)
57
- need_id = need["id"] || need[:id]
58
-
59
- url = NEED_API_ENDPOINT + "/needs/#{need_id}/content_id"
60
- stub_request(:get, url).to_return(body: need[:content_id])
61
- end
62
-
63
- def need_api_has_raw_response_for_page(response, page = nil)
64
- url = NEED_API_ENDPOINT + "/needs"
65
- url << "?page=#{page}" unless page.nil?
66
-
67
- stub_request(:get, url).to_return(status: 200, body: response, headers: {})
68
- end
69
-
70
- def need_api_has_no_need(need_id)
71
- url = NEED_API_ENDPOINT + "/needs/#{need_id}"
72
- not_found_body = {
73
- "_response_info" => { "status" => "not_found" },
74
- "error" => "No need exists with this ID"
75
- }
76
- stub_request(:get, url).to_return(
77
- status: 404,
78
- body: not_found_body.to_json,
79
- headers: {}
80
- )
81
- end
82
-
83
- def stub_create_note(note_details = nil)
84
- post_stub = stub_request(:post, NEED_API_ENDPOINT + "/notes")
85
- post_stub.with(body: note_details.to_json) unless note_details.nil?
86
- post_stub.to_return(status: 201)
87
- end
88
- end
89
- end
90
- end