contentful-management 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/contentful/management/error.rb +6 -0
- data/lib/contentful/management/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/asset/create_with_already_used_id.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/publish_already_published.yml +2 -2
- data/spec/fixtures/vcr_cassettes/asset/reload.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/activate_with_invalid_version.yml +2 -2
- data/spec/fixtures/vcr_cassettes/content_type/reload.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/publish_already_published.yml +2 -2
- data/spec/fixtures/vcr_cassettes/entry/reload.yml +2 -2
- data/spec/lib/contentful/management/asset_spec.rb +3 -3
- data/spec/lib/contentful/management/content_type_spec.rb +2 -2
- data/spec/lib/contentful/management/entry_spec.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3581e8a67bd30789f1753d50366dd02c028574e8
|
4
|
+
data.tar.gz: dffc8dcf5386575390b69436a75a9abd036ed002
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4819aeb31c3f48c551657df81db59e7d38e84004936192a1c571490fa1c8f57aaf3fac1727e5db13c289ea5ff6e85db8a96fff47ecf165020b483af5b4d23774
|
7
|
+
data.tar.gz: f853268626e356f0f0b6a05d4faf93ba3b8408170345fbff74668caddbf996cee9395b089d54df1887ccfbd951ea6ccba43067f3115a49cf451e05d3930e5446
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,9 @@
|
|
1
1
|
# Change Log
|
2
|
+
|
3
|
+
## 0.4.1
|
4
|
+
### Fixed
|
5
|
+
* Handle 409 responses as errors [#39](https://github.com/contentful/contentful-management.rb/pull/39)
|
6
|
+
|
2
7
|
## 0.4.0
|
3
8
|
### Fixed
|
4
9
|
* Return Keep attribute if it's already a hash [#33](https://github.com/contentful/contentful-management.rb/pull/33)
|
@@ -20,6 +20,8 @@ module Contentful
|
|
20
20
|
BadRequest
|
21
21
|
when 403
|
22
22
|
AccessDenied
|
23
|
+
when 409
|
24
|
+
Conflict
|
23
25
|
when 401
|
24
26
|
Unauthorized
|
25
27
|
when 500
|
@@ -47,6 +49,10 @@ module Contentful
|
|
47
49
|
# 401
|
48
50
|
class Unauthorized < Error
|
49
51
|
end
|
52
|
+
|
53
|
+
# 409
|
54
|
+
class Conflict < Error
|
55
|
+
end
|
50
56
|
|
51
57
|
# 500
|
52
58
|
class ServerError < Error
|
@@ -120,7 +120,7 @@ module Contentful
|
|
120
120
|
asset = subject.find(space_id, asset_id_2)
|
121
121
|
asset.sys[:version] = -1
|
122
122
|
result = asset.publish
|
123
|
-
expect(result).to be_kind_of Contentful::Management::
|
123
|
+
expect(result).to be_kind_of Contentful::Management::Conflict
|
124
124
|
end
|
125
125
|
end
|
126
126
|
end
|
@@ -289,7 +289,7 @@ module Contentful
|
|
289
289
|
title: 'titlebyCreateAPI_custom_id',
|
290
290
|
description: 'descByAPI_custom_id',
|
291
291
|
file: file)
|
292
|
-
expect(asset).to be_kind_of Contentful::Management::
|
292
|
+
expect(asset).to be_kind_of Contentful::Management::Conflict
|
293
293
|
end
|
294
294
|
end
|
295
295
|
end
|
@@ -356,7 +356,7 @@ module Contentful
|
|
356
356
|
asset = Contentful::Management::Asset.find(space_id, '8R4vbQXKbCkcSu26Wy2U0')
|
357
357
|
asset.sys[:version] = 999
|
358
358
|
update_asset = asset.update(title: 'Updated name')
|
359
|
-
expect(update_asset).to be_kind_of Contentful::Management::
|
359
|
+
expect(update_asset).to be_kind_of Contentful::Management::Conflict
|
360
360
|
asset.reload
|
361
361
|
update_asset = asset.update(title: 'Updated name')
|
362
362
|
expect(update_asset).to be_kind_of Contentful::Management::Asset
|
@@ -77,7 +77,7 @@ module Contentful
|
|
77
77
|
content_type = subject.find(space_id, active_content)
|
78
78
|
content_type.sys[:version] = -1
|
79
79
|
result = content_type.activate
|
80
|
-
expect(result).to be_kind_of Contentful::Management::
|
80
|
+
expect(result).to be_kind_of Contentful::Management::Conflict
|
81
81
|
end
|
82
82
|
end
|
83
83
|
end
|
@@ -527,7 +527,7 @@ module Contentful
|
|
527
527
|
content_type = Contentful::Management::ContentType.find(space_id, 'category_content_type')
|
528
528
|
content_type.sys[:version] = 999
|
529
529
|
update_ct = content_type.update(name: 'Updated content type name')
|
530
|
-
expect(update_ct).to be_kind_of Contentful::Management::
|
530
|
+
expect(update_ct).to be_kind_of Contentful::Management::Conflict
|
531
531
|
content_type.reload
|
532
532
|
update_ct = content_type.update(name: 'Updated content type name')
|
533
533
|
expect(update_ct).to be_kind_of Contentful::Management::ContentType
|
@@ -123,7 +123,7 @@ module Contentful
|
|
123
123
|
entry = subject.find(space_id, entry_id)
|
124
124
|
entry.sys[:version] = -1
|
125
125
|
result = entry.publish
|
126
|
-
expect(result).to be_kind_of Contentful::Management::
|
126
|
+
expect(result).to be_kind_of Contentful::Management::Conflict
|
127
127
|
end
|
128
128
|
end
|
129
129
|
end
|
@@ -399,7 +399,7 @@ module Contentful
|
|
399
399
|
entry = space.entries.find('2arjcjtY7ucC4AGeIOIkok')
|
400
400
|
entry.sys[:version] = 999
|
401
401
|
update_entry = entry.update(post_title: 'Updated title')
|
402
|
-
expect(update_entry).to be_kind_of Contentful::Management::
|
402
|
+
expect(update_entry).to be_kind_of Contentful::Management::Conflict
|
403
403
|
entry.reload
|
404
404
|
update_entry = entry.update(post_title: 'Updated title')
|
405
405
|
expect(update_entry).to be_kind_of Contentful::Management::Entry
|