contentful-management 2.8.0 → 2.8.1

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.
@@ -58,7 +58,6 @@ module Contentful
58
58
 
59
59
  describe 'environments' do
60
60
  let(:space_id) { 'facgnwwgj5fe' }
61
- subject { client.api_keys(space_id) }
62
61
 
63
62
  it 'can create an api key with environments' do
64
63
  vcr('api_key/create_with_environments') {
@@ -88,7 +87,6 @@ module Contentful
88
87
  describe 'preview api tokens' do
89
88
  let(:space_id) { 'facgnwwgj5fe' }
90
89
  let(:api_key_id) { '5mxNhKOZYOp1wzafOR9qPw' }
91
- subject { client.api_keys(space_id) }
92
90
 
93
91
  it 'can fetch preview api keys' do
94
92
  vcr('api_key/preview') {
@@ -102,6 +100,24 @@ module Contentful
102
100
  }
103
101
  end
104
102
  end
103
+
104
+ describe 'issues' do
105
+ let(:space_id) { 'facgnwwgj5fe' }
106
+ it 'can save an api key - #189' do
107
+ vcr('api_key/issue_189') {
108
+ api_key = subject.find('5rjsSfZUvHJnWBDkbcCsem')
109
+
110
+ expect(api_key.name).to eq 'test - updated'
111
+
112
+ api_key.name = 'test - updated 2'
113
+ api_key.save
114
+
115
+ api_key.reload
116
+
117
+ expect(api_key.name).to eq 'test - updated 2'
118
+ }
119
+ end
120
+ end
105
121
  end
106
122
  end
107
123
  end
@@ -122,4 +122,21 @@ describe Contentful::Management::Environment do
122
122
  }
123
123
  end
124
124
  end
125
+
126
+ describe 'issues' do
127
+ it 'can save an environment - #189' do
128
+ vcr('environment/issue_189') {
129
+ environment = subject.find('testing')
130
+
131
+ expect(environment.name).to eq 'testing'
132
+
133
+ environment.name = 'testing 2'
134
+ environment.save
135
+
136
+ environment.reload
137
+
138
+ expect(environment.name).to eq 'testing 2'
139
+ }
140
+ end
141
+ end
125
142
  end
@@ -161,7 +161,7 @@ module Contentful
161
161
  end
162
162
 
163
163
  describe 'issues' do
164
- let!(:space_id) { 'facgnwwgj5fe' }
164
+ let(:space_id) { 'facgnwwgj5fe' }
165
165
  it 'should be able to create a locale with a fallback code' do
166
166
  vcr('locale/fallback_code') do
167
167
  locale = subject.create(name: 'Foo (BarBaz)', code: 'foo-BB', fallback_code: 'en-US')
@@ -169,6 +169,21 @@ module Contentful
169
169
  expect(subject.find(locale.id).code).to eq 'foo-BB'
170
170
  end
171
171
  end
172
+
173
+ it 'can save a locale - #189' do
174
+ vcr('locale/issue_189') do
175
+ locale = subject.find('4brXbuf0CeMWo4vlIfWe0q')
176
+
177
+ expect(locale.code).to eq 'bar'
178
+
179
+ locale.code = 'bar2'
180
+ locale.save
181
+
182
+ locale.reload
183
+
184
+ expect(locale.code).to eq 'bar2'
185
+ end
186
+ end
172
187
  end
173
188
  end
174
189
  end
@@ -5,7 +5,7 @@ require 'contentful/management/client'
5
5
  module Contentful
6
6
  module Management
7
7
  describe Role do
8
- let(:token) { '<ACCESS_TOKEN>' }
8
+ let(:token) { ENV.fetch('CF_TEST_CMA_TOKEN', '<ACCESS_TOKEN>') }
9
9
  let(:space_id) { '03vrieuz7eun' }
10
10
  let(:role_id) { '0rQMQMd6ZTgeF7hxjz7JDi' }
11
11
 
@@ -120,6 +120,25 @@ module Contentful
120
120
  end
121
121
  end
122
122
  end
123
+
124
+ describe 'issues' do
125
+ let(:space_id) { 'facgnwwgj5fe' }
126
+
127
+ it 'can save a role - #189' do
128
+ vcr('roles/issue_189') {
129
+ role = subject.find('1NzxmNIjPtzpJae5OL1m4u')
130
+
131
+ expect(role.name).to eq 'Translator 1'
132
+
133
+ role.name = 'Translator - Updated'
134
+ role.save
135
+
136
+ role.reload
137
+
138
+ expect(role.name).to eq 'Translator - Updated'
139
+ }
140
+ end
141
+ end
123
142
  end
124
143
  end
125
144
  end
@@ -221,6 +221,25 @@ module Contentful
221
221
  end
222
222
  end
223
223
  end
224
+
225
+ describe 'issues' do
226
+ let(:space_id) { 'no8f22w4syte' }
227
+
228
+ it 'can save a space - #189' do
229
+ vcr('space/issue_189') {
230
+ space = subject.find(space_id)
231
+
232
+ expect(space.name).to eq 'foo'
233
+
234
+ space.name = 'bar'
235
+ space.save
236
+
237
+ space.reload
238
+
239
+ expect(space.name).to eq 'bar'
240
+ }
241
+ end
242
+ end
224
243
  end
225
244
  end
226
245
  end
@@ -169,6 +169,25 @@ module Contentful
169
169
  end
170
170
  end
171
171
  end
172
+
173
+ describe 'issues' do
174
+ let(:space_id) { 'facgnwwgj5fe' }
175
+
176
+ it 'can properly update attributes - #189' do
177
+ vcr('webhook/issue_189') do
178
+ webhook = subject.find('0Kgjs0DQizupIbmSHcyaFM')
179
+
180
+ expect(webhook.url).to eq 'https://www.example.com'
181
+
182
+ webhook.url = 'https://www.example2.com'
183
+ webhook.save
184
+
185
+ webhook.reload
186
+
187
+ expect(webhook.url).to eq 'https://www.example2.com'
188
+ end
189
+ end
190
+ end
172
191
  end
173
192
  end
174
193
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contentful-management
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.0
4
+ version: 2.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Protas
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-03-06 00:00:00.000000000 Z
13
+ date: 2019-04-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: http
@@ -417,6 +417,7 @@ files:
417
417
  - spec/fixtures/vcr_cassettes/api_key/create_with_environments.yml
418
418
  - spec/fixtures/vcr_cassettes/api_key/find.yml
419
419
  - spec/fixtures/vcr_cassettes/api_key/find_for_space_not_found.yml
420
+ - spec/fixtures/vcr_cassettes/api_key/issue_189.yml
420
421
  - spec/fixtures/vcr_cassettes/api_key/preview.yml
421
422
  - spec/fixtures/vcr_cassettes/api_usage/all.yml
422
423
  - spec/fixtures/vcr_cassettes/array_page_1.yml
@@ -611,6 +612,7 @@ files:
611
612
  - spec/fixtures/vcr_cassettes/environment/find.yml
612
613
  - spec/fixtures/vcr_cassettes/environment/find_2.yml
613
614
  - spec/fixtures/vcr_cassettes/environment/find_3.yml
615
+ - spec/fixtures/vcr_cassettes/environment/issue_189.yml
614
616
  - spec/fixtures/vcr_cassettes/environment/not_found.yml
615
617
  - spec/fixtures/vcr_cassettes/get_request.yml
616
618
  - spec/fixtures/vcr_cassettes/locale/all_for_space.yml
@@ -623,6 +625,7 @@ files:
623
625
  - spec/fixtures/vcr_cassettes/locale/find_not_default.yml
624
626
  - spec/fixtures/vcr_cassettes/locale/find_not_optional.yml
625
627
  - spec/fixtures/vcr_cassettes/locale/find_optional.yml
628
+ - spec/fixtures/vcr_cassettes/locale/issue_189.yml
626
629
  - spec/fixtures/vcr_cassettes/locale/reload.yml
627
630
  - spec/fixtures/vcr_cassettes/locale/update_both.yml
628
631
  - spec/fixtures/vcr_cassettes/locale/update_code.yml
@@ -641,6 +644,7 @@ files:
641
644
  - spec/fixtures/vcr_cassettes/roles/destroy.yml
642
645
  - spec/fixtures/vcr_cassettes/roles/find.yml
643
646
  - spec/fixtures/vcr_cassettes/roles/find_for_space_not_found.yml
647
+ - spec/fixtures/vcr_cassettes/roles/issue_189.yml
644
648
  - spec/fixtures/vcr_cassettes/roles/update.yml
645
649
  - spec/fixtures/vcr_cassettes/snapshot/all.yml
646
650
  - spec/fixtures/vcr_cassettes/snapshot/ct_all.yml
@@ -681,6 +685,7 @@ files:
681
685
  - spec/fixtures/vcr_cassettes/space/entry/with_skipped_andlimited_entires.yml
682
686
  - spec/fixtures/vcr_cassettes/space/find.yml
683
687
  - spec/fixtures/vcr_cassettes/space/find_not_found.yml
688
+ - spec/fixtures/vcr_cassettes/space/issue_189.yml
684
689
  - spec/fixtures/vcr_cassettes/space/locale/all.yml
685
690
  - spec/fixtures/vcr_cassettes/space/locale/create.yml
686
691
  - spec/fixtures/vcr_cassettes/space/locale/create_with_the_same_code.yml
@@ -722,6 +727,7 @@ files:
722
727
  - spec/fixtures/vcr_cassettes/webhook/filters.yml
723
728
  - spec/fixtures/vcr_cassettes/webhook/find.yml
724
729
  - spec/fixtures/vcr_cassettes/webhook/find_not_found.yml
730
+ - spec/fixtures/vcr_cassettes/webhook/issue_189.yml
725
731
  - spec/fixtures/vcr_cassettes/webhook/topics.yml
726
732
  - spec/fixtures/vcr_cassettes/webhook/transformation.yml
727
733
  - spec/fixtures/vcr_cassettes/webhook/update.yml
@@ -812,6 +818,7 @@ test_files:
812
818
  - spec/fixtures/vcr_cassettes/api_key/create_with_environments.yml
813
819
  - spec/fixtures/vcr_cassettes/api_key/find.yml
814
820
  - spec/fixtures/vcr_cassettes/api_key/find_for_space_not_found.yml
821
+ - spec/fixtures/vcr_cassettes/api_key/issue_189.yml
815
822
  - spec/fixtures/vcr_cassettes/api_key/preview.yml
816
823
  - spec/fixtures/vcr_cassettes/api_usage/all.yml
817
824
  - spec/fixtures/vcr_cassettes/array_page_1.yml
@@ -1006,6 +1013,7 @@ test_files:
1006
1013
  - spec/fixtures/vcr_cassettes/environment/find.yml
1007
1014
  - spec/fixtures/vcr_cassettes/environment/find_2.yml
1008
1015
  - spec/fixtures/vcr_cassettes/environment/find_3.yml
1016
+ - spec/fixtures/vcr_cassettes/environment/issue_189.yml
1009
1017
  - spec/fixtures/vcr_cassettes/environment/not_found.yml
1010
1018
  - spec/fixtures/vcr_cassettes/get_request.yml
1011
1019
  - spec/fixtures/vcr_cassettes/locale/all_for_space.yml
@@ -1018,6 +1026,7 @@ test_files:
1018
1026
  - spec/fixtures/vcr_cassettes/locale/find_not_default.yml
1019
1027
  - spec/fixtures/vcr_cassettes/locale/find_not_optional.yml
1020
1028
  - spec/fixtures/vcr_cassettes/locale/find_optional.yml
1029
+ - spec/fixtures/vcr_cassettes/locale/issue_189.yml
1021
1030
  - spec/fixtures/vcr_cassettes/locale/reload.yml
1022
1031
  - spec/fixtures/vcr_cassettes/locale/update_both.yml
1023
1032
  - spec/fixtures/vcr_cassettes/locale/update_code.yml
@@ -1036,6 +1045,7 @@ test_files:
1036
1045
  - spec/fixtures/vcr_cassettes/roles/destroy.yml
1037
1046
  - spec/fixtures/vcr_cassettes/roles/find.yml
1038
1047
  - spec/fixtures/vcr_cassettes/roles/find_for_space_not_found.yml
1048
+ - spec/fixtures/vcr_cassettes/roles/issue_189.yml
1039
1049
  - spec/fixtures/vcr_cassettes/roles/update.yml
1040
1050
  - spec/fixtures/vcr_cassettes/snapshot/all.yml
1041
1051
  - spec/fixtures/vcr_cassettes/snapshot/ct_all.yml
@@ -1076,6 +1086,7 @@ test_files:
1076
1086
  - spec/fixtures/vcr_cassettes/space/entry/with_skipped_andlimited_entires.yml
1077
1087
  - spec/fixtures/vcr_cassettes/space/find.yml
1078
1088
  - spec/fixtures/vcr_cassettes/space/find_not_found.yml
1089
+ - spec/fixtures/vcr_cassettes/space/issue_189.yml
1079
1090
  - spec/fixtures/vcr_cassettes/space/locale/all.yml
1080
1091
  - spec/fixtures/vcr_cassettes/space/locale/create.yml
1081
1092
  - spec/fixtures/vcr_cassettes/space/locale/create_with_the_same_code.yml
@@ -1117,6 +1128,7 @@ test_files:
1117
1128
  - spec/fixtures/vcr_cassettes/webhook/filters.yml
1118
1129
  - spec/fixtures/vcr_cassettes/webhook/find.yml
1119
1130
  - spec/fixtures/vcr_cassettes/webhook/find_not_found.yml
1131
+ - spec/fixtures/vcr_cassettes/webhook/issue_189.yml
1120
1132
  - spec/fixtures/vcr_cassettes/webhook/topics.yml
1121
1133
  - spec/fixtures/vcr_cassettes/webhook/transformation.yml
1122
1134
  - spec/fixtures/vcr_cassettes/webhook/update.yml