gds-api-adapters 31.0.0 → 31.1.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 +4 -4
- data/README.md +18 -1
- data/lib/gds_api/test_helpers/publishing_api_v2.rb +4 -0
- data/lib/gds_api/version.rb +1 -1
- data/test/test_helpers/publishing_api_v2_test.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3958ad60a4dd784913638e24174ec1cbaa6bf5bf
|
4
|
+
data.tar.gz: 472556864dd1a993b30ac799f92d00f103323929
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
data/lib/gds_api/version.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2016-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: plek
|