gds-api-adapters 31.0.0 → 31.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07244f73dba6d5b8f4d0f8af88d5d4fe7a7af7a4
4
- data.tar.gz: 2d45b90cd1854aa4232a710216377b3f1ce6e043
3
+ metadata.gz: 3958ad60a4dd784913638e24174ec1cbaa6bf5bf
4
+ data.tar.gz: 472556864dd1a993b30ac799f92d00f103323929
5
5
  SHA512:
6
- metadata.gz: a251c06b06fbe266e659c08d389787aa1cb01bca5d2b92cc8d90ea7f5635e37ae8ae699986b8d071582dd3de26e514bcae351241ec566f726ee6b3b1d8d6b7d4
7
- data.tar.gz: 152bf7e4596016897c9b0229c2c5731cdd19699a5f38e09ba85740b8b3a7d9acb729bcba808153f345c706abde9687e3a08f38d28688e42baebd416906c01e05
6
+ metadata.gz: d7fe0d40e473efb738e009106cb05bf5fba2b93661c32696ad7ec5ee53840c92a45acf43e2ecc05d104088d5ab6eee0cf2da06ef6241316fb4b29dc7e63c1529
7
+ data.tar.gz: 67310a8f8a8b02a4779d372d9dc8b7416de404af60c66411c217149899051b6bc036592ff6eb6ff34982244fa00aab3f9f6c17ee5c3cce13788b99b5352e4af8
data/README.md CHANGED
@@ -32,7 +32,24 @@ By default we log to a NullLogger since we don't want to pollute your test
32
32
  results or logs. To log output you'll want to set `GdsApi::Base.logger` to
33
33
  something that actually logs:
34
34
 
35
- GdsApi::Base.logger = Logger.new("/path/to/file.log")
35
+ ```ruby
36
+ GdsApi::Base.logger = Logger.new("/path/to/file.log")
37
+ ```
38
+
39
+ ## Setting the timeout
40
+
41
+ By default the JsonClient timeout is set to 4 seconds. If this is exceeded a
42
+ `GdsApi::TimedOutException` will be raised. Individual clients may decide to
43
+ override this timeout. Alternatively, you can override this in the application
44
+ that uses the adapter with:
45
+
46
+ ```ruby
47
+ Services.publishing_api.client.options[:timeout] = number_of_seconds
48
+ ```
49
+
50
+ In most cases, there is an upper-limit of 30 seconds imposed by the app server
51
+ or Nginx. If your requests are taking this long, you should probably be looking
52
+ into other options to lower the response time.
36
53
 
37
54
  ## Middleware for request tracing
38
55
 
@@ -76,6 +76,10 @@ module GdsApi
76
76
  stub_request(:patch, %r{\A#{PUBLISHING_API_V2_ENDPOINT}/links/})
77
77
  end
78
78
 
79
+ def stub_any_publishing_api_publish
80
+ stub_request(:post, %r{\A#{PUBLISHING_API_V2_ENDPOINT}/content/.*/publish})
81
+ end
82
+
79
83
  def stub_any_publishing_api_call
80
84
  stub_request(:any, %r{\A#{PUBLISHING_API_V2_ENDPOINT}})
81
85
  end
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '31.0.0'
2
+ VERSION = '31.1.0'
3
3
  end
@@ -51,4 +51,12 @@ describe GdsApi::TestHelpers::PublishingApiV2 do
51
51
  }, response.to_h)
52
52
  end
53
53
  end
54
+
55
+ describe "stub_any_publishing_api_publish" do
56
+ it "stubs any publish request to the publishing api" do
57
+ stub_any_publishing_api_publish
58
+ publishing_api.publish("some-content-id", "major")
59
+ assert_publishing_api_publish("some-content-id")
60
+ end
61
+ end
54
62
  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: 31.0.0
4
+ version: 31.1.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: 2016-06-10 00:00:00.000000000 Z
11
+ date: 2016-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: plek