gds-api-adapters 57.2.1 → 57.2.2

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
  SHA256:
3
- metadata.gz: 2e65dcaa3a0001231ff5d033d381286b24548f1e3c8d245bbfba5071342f94dc
4
- data.tar.gz: 8ecb665684b90b048ccfaf3993cd4b6d5787cfd7944b9bd065975ecf6ab7f7f4
3
+ metadata.gz: bc1caa2602fa185427e439ce219c7a1c357fa42368844a27a658c63b60e9a7bd
4
+ data.tar.gz: bf3229785b2ae808923336acad595af6cbe4a0f74b37340603ef34cbfedc8eb4
5
5
  SHA512:
6
- metadata.gz: 65fe39b964e1273beb7a1e4a4c22448ba285ee521daaf5a439e70ff43b87c05ebbbacf7c9eb418461bc738e763d4f82105bf4fe0503830ba5778823f7897854b
7
- data.tar.gz: c45eac20885b378da06f0e919546586e02b15ef260ab74c615be9acba9e272b8f8c765ff94904aa3f54ed13c38b98195f61f1181a1d12c6fec4f0b8bb1023a4e
6
+ metadata.gz: ca70d89e4f4fb120ea7ec946329cb2dff7e12bb926c6e8e51698a68f572f78b897217a2d41fff61c233dd5d915a3acb9ea142cbe2d6167e6de59efda6fa14d98
7
+ data.tar.gz: 968cda1996efbc0d76c039c62a555479f93e887781b06fe64ffbcd14bd80b3767b9dd810cfd0ccc39d77b4f70e56994fadff5f1122b8dc1681f2ae36ffbf05dd
@@ -7,7 +7,7 @@ module GdsApi
7
7
  stub_request(:any, %r{\A#{ASSET_MANAGER_ENDPOINT}}).to_return(status: 200)
8
8
  end
9
9
 
10
- def stub_asset_manager_is_down
10
+ def stub_asset_manager_isnt_available
11
11
  stub_request(:any, %r{\A#{ASSET_MANAGER_ENDPOINT}}).to_return(status: 503)
12
12
  end
13
13
 
@@ -68,15 +68,17 @@ module GdsApi
68
68
  # which would return a file url of "https://asset-manager/media/0053adbf-0737-4923-9d8a-8180f2c723af/0d19136c4a94f07"
69
69
  def stub_asset_manager_receives_an_asset(response_url = {})
70
70
  stub_request(:post, "#{ASSET_MANAGER_ENDPOINT}/assets").to_return do
71
- unless response_url.is_a?(String)
71
+ if response_url.is_a?(String)
72
+ file_url = response_url
73
+ else
72
74
  options = {
73
75
  id: SecureRandom.uuid,
74
76
  filename: SecureRandom.hex(8)
75
77
  }.merge(response_url)
76
78
 
77
- response_url = "#{ASSET_MANAGER_ENDPOINT}/media/#{options[:id]}/#{options[:filename]}"
79
+ file_url = "#{ASSET_MANAGER_ENDPOINT}/media/#{options[:id]}/#{options[:filename]}"
78
80
  end
79
- { body: { file_url: response_url }.to_json, status: 200 }
81
+ { body: { file_url: file_url }.to_json, status: 200 }
80
82
  end
81
83
  end
82
84
 
@@ -103,7 +105,6 @@ module GdsApi
103
105
  end
104
106
 
105
107
  # Aliases for DEPRECATED methods
106
- alias_method :asset_manager_is_down, :stub_asset_manager_is_down
107
108
  alias_method :asset_manager_updates_any_asset, :stub_asset_manager_updates_any_asset
108
109
  alias_method :asset_manager_deletes_any_asset, :stub_asset_manager_deletes_any_asset
109
110
  alias_method :asset_manager_has_an_asset, :stub_asset_manager_has_an_asset
@@ -111,6 +112,7 @@ module GdsApi
111
112
  alias_method :asset_manager_does_not_have_an_asset, :stub_asset_manager_does_not_have_an_asset
112
113
  alias_method :asset_manager_does_not_have_a_whitehall_asset, :stub_asset_manager_does_not_have_a_whitehall_asset
113
114
  alias_method :asset_manager_receives_an_asset, :stub_asset_manager_receives_an_asset
115
+ alias_method :asset_manager_upload_failure, :stub_asset_manager_upload_failure
114
116
  alias_method :asset_manager_update_asset, :stub_asset_manager_update_asset
115
117
  alias_method :asset_manager_update_failure, :stub_asset_manager_update_asset_failure
116
118
  alias_method :asset_manager_delete_asset, :stub_asset_manager_delete_asset
@@ -91,12 +91,12 @@ module GdsApi
91
91
  end
92
92
 
93
93
  # Aliases for DEPRECATED methods
94
- alias_method :link_link_checker_api_link_report_hash, :stub_link_checker_api_link_report_hash
95
- alias_method :link_link_checker_api_batch_report_hash, :stub_link_checker_api_batch_report_hash
96
- alias_method :link_link_checker_api_check, :stub_link_checker_api_check
97
- alias_method :link_link_checker_api_get_batch, :stub_link_checker_api_get_batch
98
- alias_method :link_link_checker_api_create_batch, :stub_link_checker_api_create_batch
99
- alias_method :link_link_checker_api_upsert_resource_monitor, :stub_link_checker_api_upsert_resource_monitor
94
+ alias_method :link_checker_api_link_report_hash, :stub_link_checker_api_link_report_hash
95
+ alias_method :link_checker_api_batch_report_hash, :stub_link_checker_api_batch_report_hash
96
+ alias_method :link_checker_api_check, :stub_link_checker_api_check
97
+ alias_method :link_checker_api_get_batch, :stub_link_checker_api_get_batch
98
+ alias_method :link_checker_api_create_batch, :stub_link_checker_api_create_batch
99
+ alias_method :link_checker_api_upsert_resource_monitor, :stub_link_checker_api_upsert_resource_monitor
100
100
  end
101
101
  end
102
102
  end
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '57.2.1'.freeze
2
+ VERSION = '57.2.2'.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: 57.2.1
4
+ version: 57.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-23 00:00:00.000000000 Z
11
+ date: 2019-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable