gds-api-adapters 10.11.0 → 10.11.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,42 @@
1
+ require 'gds_api/test_helpers/json_client_helper'
2
+
3
+ module GdsApi
4
+ module TestHelpers
5
+ module Router
6
+ ROUTER_API_ENDPOINT = Plek.current.find('router-api')
7
+
8
+ def stub_route_registration(path, type, backend_id)
9
+ route = { route: {
10
+ incoming_path: path,
11
+ route_type: type,
12
+ handler: 'backend',
13
+ backend_id: backend_id }
14
+ }
15
+
16
+ stub_router_put(route)
17
+ stub_http_request(:post, "#{ROUTER_API_ENDPOINT}/routes/commit")
18
+ end
19
+
20
+ def stub_redirect_registration(path, type, destination, redirect_type)
21
+ redirect = { route: {
22
+ incoming_path: path,
23
+ route_type: type,
24
+ handler: 'redirect',
25
+ redirect_to: destination,
26
+ redirect_type: redirect_type }
27
+ }
28
+
29
+ stub_router_put(redirect)
30
+ stub_http_request(:post, "#{ROUTER_API_ENDPOINT}/routes/commit")
31
+ end
32
+
33
+ private
34
+
35
+ def stub_router_put(route)
36
+ stub_http_request(:put, "#{ROUTER_API_ENDPOINT}/routes")
37
+ .with(:body => route.to_json)
38
+ .to_return(:status => 201)
39
+ end
40
+ end
41
+ end
42
+ end
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '10.11.0'
2
+ VERSION = '10.11.1'
3
3
  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: 10.11.0
4
+ version: 10.11.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-05-01 00:00:00.000000000 Z
12
+ date: 2014-05-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: plek
@@ -307,6 +307,7 @@ files:
307
307
  - lib/gds_api/test_helpers/gov_uk_delivery.rb
308
308
  - lib/gds_api/test_helpers/fact_cave.rb
309
309
  - lib/gds_api/test_helpers/publisher.rb
310
+ - lib/gds_api/test_helpers/router.rb
310
311
  - lib/gds_api/test_helpers/common_responses.rb
311
312
  - lib/gds_api/test_helpers/business_support_api.rb
312
313
  - lib/gds_api/test_helpers/content_api.rb
@@ -378,7 +379,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
378
379
  version: '0'
379
380
  segments:
380
381
  - 0
381
- hash: -464259453023716880
382
+ hash: -4411735223045544761
382
383
  required_rubygems_version: !ruby/object:Gem::Requirement
383
384
  none: false
384
385
  requirements:
@@ -387,7 +388,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
387
388
  version: '0'
388
389
  segments:
389
390
  - 0
390
- hash: -464259453023716880
391
+ hash: -4411735223045544761
391
392
  requirements: []
392
393
  rubyforge_project:
393
394
  rubygems_version: 1.8.23