gds-api-adapters 12.0.0 → 12.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,34 @@
1
+ require 'gds_api/test_helpers/json_client_helper'
2
+
3
+ module GdsApi
4
+ module TestHelpers
5
+ module Rummager
6
+ def rummager_has_services_and_info_data_for_organisation
7
+ stub_request(:get, /example.com\/unified_search/).to_return(body: search_results)
8
+ client.unified_search(example_query)
9
+ end
10
+
11
+ private
12
+
13
+ def search_results
14
+ File.read(
15
+ File.expand_path(
16
+ "../../../../test/fixtures/services_and_info_fixture.json",
17
+ __FILE__
18
+ )
19
+ )
20
+ end
21
+
22
+ def client
23
+ GdsApi::Rummager.new("http://example.com")
24
+ end
25
+
26
+ def example_query
27
+ {
28
+ filter_organisations: ["an-organisation-slug"],
29
+ facet_specialist_sectors: "1000,examples:4,example_scope:global"
30
+ }
31
+ end
32
+ end
33
+ end
34
+ end
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '12.0.0'
2
+ VERSION = '12.1.0'
3
3
  end
@@ -0,0 +1,71 @@
1
+ {
2
+ "results": [ ],
3
+ "total": 3138,
4
+ "start": 0,
5
+ "facets": {
6
+ "specialist_sectors": {
7
+ "options": [
8
+ {
9
+ "value": {
10
+ "title": "Waste",
11
+ "slug": "environmental-management/waste",
12
+ "example_info": {
13
+ "total": 49,
14
+ "examples": [
15
+ {
16
+ "title": "Register as a waste carrier, broker or dealer (England)",
17
+ "link": "/waste-carrier-or-broker-registration"
18
+ },
19
+ {
20
+ "title": "Hazardous waste producer registration (England and Wales)",
21
+ "link": "/hazardous-waste-producer-registration"
22
+ },
23
+ {
24
+ "title": "Check if you need an environmental permit",
25
+ "link": "/environmental-permit-check-if-you-need-one"
26
+ },
27
+ {
28
+ "title": "Classify different types of waste",
29
+ "link": "/how-to-classify-different-types-of-waste"
30
+ }
31
+ ]
32
+ }
33
+ },
34
+ "documents": 47
35
+ },
36
+ {
37
+ "value": {
38
+ "title": "Environmental permits",
39
+ "slug": "environmental-management/environmental-permits",
40
+ "example_info": {
41
+ "total": 47,
42
+ "examples": [
43
+ {
44
+ "title": "Check if you need an environmental permit",
45
+ "link": "/environmental-permit-check-if-you-need-one"
46
+ },
47
+ {
48
+ "title": "Environmental permit: how to apply",
49
+ "link": "/environmental-permit-how-to-apply"
50
+ },
51
+ {
52
+ "title": "Standard rules: environmental permitting",
53
+ "link": "/government/collections/standard-rules-environmental-permitting"
54
+ },
55
+ {
56
+ "title": "Environmental permitting (EP) charges scheme: April 2014 to March 2015",
57
+ "link": "/government/publications/environmental-permitting-ep-charges-scheme-april-2014-to-march-2015"
58
+ }
59
+ ]
60
+ }
61
+ },
62
+ "documents": 47
63
+ }
64
+ ],
65
+ "documents_with_no_value": 2900,
66
+ "total_options": 17,
67
+ "missing_options": 0
68
+ }
69
+ },
70
+ "suggested_queries": [ ]
71
+ }
@@ -0,0 +1,13 @@
1
+ require 'test_helper'
2
+ require 'gds_api/rummager'
3
+ require 'gds_api/test_helpers/rummager'
4
+
5
+ class RummagerHelpersTest < MiniTest::Unit::TestCase
6
+ include GdsApi::TestHelpers::Rummager
7
+
8
+ def test_services_and_info_data_returns_an_adequate_response_object
9
+ response = rummager_has_services_and_info_data_for_organisation
10
+
11
+ assert_instance_of GdsApi::Response, response
12
+ end
13
+ 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: 12.0.0
4
+ version: 12.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -291,6 +291,7 @@ files:
291
291
  - lib/gds_api/version.rb
292
292
  - lib/gds_api/panopticon/registerer.rb
293
293
  - lib/gds_api/test_helpers/support.rb
294
+ - lib/gds_api/test_helpers/rummager.rb
294
295
  - lib/gds_api/test_helpers/need_api.rb
295
296
  - lib/gds_api/test_helpers/finder_api.rb
296
297
  - lib/gds_api/test_helpers/content_api/artefact_stub.rb
@@ -344,6 +345,7 @@ files:
344
345
  - test/finder_schema_test.rb
345
346
  - test/need_api_test.rb
346
347
  - test/publisher_api_test.rb
348
+ - test/rummager_helpers_test.rb
347
349
  - test/support_test.rb
348
350
  - test/fact_cave_test.rb
349
351
  - test/finder_api_test.rb
@@ -363,6 +365,7 @@ files:
363
365
  - test/asset_manager_test.rb
364
366
  - test/fixtures/hello.txt
365
367
  - test/fixtures/world_organisations_australia.json
368
+ - test/fixtures/services_and_info_fixture.json
366
369
  - test/fixtures/finder_api/cma-case-schema.json
367
370
  - test/router_test.rb
368
371
  - test/list_response_test.rb
@@ -385,7 +388,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
385
388
  version: '0'
386
389
  segments:
387
390
  - 0
388
- hash: -1023858681611689448
391
+ hash: 2356146172275700055
389
392
  required_rubygems_version: !ruby/object:Gem::Requirement
390
393
  none: false
391
394
  requirements:
@@ -394,7 +397,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
394
397
  version: '0'
395
398
  segments:
396
399
  - 0
397
- hash: -1023858681611689448
400
+ hash: 2356146172275700055
398
401
  requirements: []
399
402
  rubyforge_project:
400
403
  rubygems_version: 1.8.23
@@ -408,6 +411,7 @@ test_files:
408
411
  - test/finder_schema_test.rb
409
412
  - test/need_api_test.rb
410
413
  - test/publisher_api_test.rb
414
+ - test/rummager_helpers_test.rb
411
415
  - test/support_test.rb
412
416
  - test/fact_cave_test.rb
413
417
  - test/finder_api_test.rb
@@ -427,6 +431,7 @@ test_files:
427
431
  - test/asset_manager_test.rb
428
432
  - test/fixtures/hello.txt
429
433
  - test/fixtures/world_organisations_australia.json
434
+ - test/fixtures/services_and_info_fixture.json
430
435
  - test/fixtures/finder_api/cma-case-schema.json
431
436
  - test/router_test.rb
432
437
  - test/list_response_test.rb