contentful-management 2.11.0 → 2.12.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/CHANGELOG.md +11 -0
- data/README.md +19 -13
- data/lib/contentful/management/client.rb +10 -12
- data/lib/contentful/management/{client_usage_period_methods_factory.rb → client_organization_periodic_usage_methods_factory.rb} +3 -4
- data/lib/contentful/management/{client_api_usage_methods_factory.rb → client_space_periodic_usage_methods_factory.rb} +4 -11
- data/lib/contentful/management/organization.rb +8 -8
- data/lib/contentful/management/{api_usage.rb → organization_periodic_usage.rb} +13 -18
- data/lib/contentful/management/resource_builder.rb +4 -4
- data/lib/contentful/management/{usage_period.rb → space_periodic_usage.rb} +12 -9
- data/lib/contentful/management/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/organization_periodic_usage/all.yml +368 -0
- data/spec/fixtures/vcr_cassettes/organization_periodic_usage/filters.yml +167 -0
- data/spec/fixtures/vcr_cassettes/space_periodic_usage/all.yml +6800 -0
- data/spec/fixtures/vcr_cassettes/space_periodic_usage/filters.yml +1976 -0
- data/spec/lib/contentful/management/organization_periodic_usage_spec.rb +36 -0
- data/spec/lib/contentful/management/space_periodic_usage_spec.rb +36 -0
- metadata +18 -14
- data/spec/fixtures/vcr_cassettes/api_usage/all.yml +0 -155
- data/spec/fixtures/vcr_cassettes/usage_period/all.yml +0 -114
- data/spec/lib/contentful/management/api_usage_spec.rb +0 -28
- data/spec/lib/contentful/management/usage_period_spec.rb +0 -27
@@ -1,28 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'contentful/management/space'
|
3
|
-
require 'contentful/management/client'
|
4
|
-
|
5
|
-
module Contentful
|
6
|
-
module Management
|
7
|
-
describe ApiKey do
|
8
|
-
let(:token) { ENV.fetch('CF_TEST_CMA_TOKEN', '<ACCESS_TOKEN>') }
|
9
|
-
let(:organization_id) { 'org_id' }
|
10
|
-
|
11
|
-
let!(:client) { Client.new(token ) }
|
12
|
-
|
13
|
-
subject { client.api_usage(organization_id) }
|
14
|
-
|
15
|
-
describe '.all' do
|
16
|
-
it 'class method also works' do
|
17
|
-
vcr('api_usage/all') { expect(Contentful::Management::ApiUsage.all(client, organization_id, 'organization', 1, 'cda')).to be_kind_of Contentful::Management::Array }
|
18
|
-
end
|
19
|
-
it 'returns a Contentful::Array' do
|
20
|
-
vcr('api_usage/all') { expect(subject.all('organization', 1, 'cda')).to be_kind_of Contentful::Management::Array }
|
21
|
-
end
|
22
|
-
it 'builds a Contentful::Management::ApiUsage object' do
|
23
|
-
vcr('api_usage/all') { expect(subject.all('organization', 1, 'cda').first).to be_kind_of Contentful::Management::ApiUsage }
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'contentful/management/client'
|
3
|
-
|
4
|
-
module Contentful
|
5
|
-
module Management
|
6
|
-
describe ApiKey do
|
7
|
-
let(:token) { ENV.fetch('CF_TEST_CMA_TOKEN', '<ACCESS_TOKEN>') }
|
8
|
-
let(:organization_id) { 'org_id' }
|
9
|
-
|
10
|
-
let!(:client) { Client.new(token ) }
|
11
|
-
|
12
|
-
subject { client.usage_periods(organization_id) }
|
13
|
-
|
14
|
-
describe '.all' do
|
15
|
-
it 'class method also works' do
|
16
|
-
vcr('usage_period/all') { expect(Contentful::Management::UsagePeriod.all(client, organization_id)).to be_kind_of Contentful::Management::Array }
|
17
|
-
end
|
18
|
-
it 'returns a Contentful::Array' do
|
19
|
-
vcr('usage_period/all') { expect(subject.all).to be_kind_of Contentful::Management::Array }
|
20
|
-
end
|
21
|
-
it 'builds a Contentful::Management::UsagePeriod object' do
|
22
|
-
vcr('usage_period/all') { expect(subject.all.first).to be_kind_of Contentful::Management::UsagePeriod }
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|