Sha256: e53fb567295800ac4a0f9b82daf69f5c1a897aef1d8f60bb33ce0132bcdade84

Contents?: true

Size: 1.02 KB

Versions: 9

Compression:

Stored size: 1.02 KB

Contents

require 'spec_helper'
require 'contentful/management/space'
require 'contentful/management/client'

module Contentful
  module Management
    describe ApiKey do
      let(:token) { ENV.fetch('CF_TEST_CMA_TOKEN', '<ACCESS_TOKEN>') }
      let(:organization_id) { 'org_id' }

      let!(:client) { Client.new(token ) }

      subject { client.api_usage(organization_id) }

      describe '.all' do
        it 'class method also works' do
          vcr('api_usage/all') { expect(Contentful::Management::ApiUsage.all(client, organization_id, 'organization', 1, 'cda')).to be_kind_of Contentful::Management::Array }
        end
        it 'returns a Contentful::Array' do
          vcr('api_usage/all') { expect(subject.all('organization', 1, 'cda')).to be_kind_of Contentful::Management::Array }
        end
        it 'builds a Contentful::Management::ApiUsage object' do
          vcr('api_usage/all') { expect(subject.all('organization', 1, 'cda').first).to be_kind_of Contentful::Management::ApiUsage }
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
contentful-management-2.11.0 spec/lib/contentful/management/api_usage_spec.rb
contentful-management-2.10.0 spec/lib/contentful/management/api_usage_spec.rb
contentful-management-2.9.1 spec/lib/contentful/management/api_usage_spec.rb
contentful-management-2.9.0 spec/lib/contentful/management/api_usage_spec.rb
contentful-management-2.8.2 spec/lib/contentful/management/api_usage_spec.rb
contentful-management-2.8.1 spec/lib/contentful/management/api_usage_spec.rb
contentful-management-2.8.0 spec/lib/contentful/management/api_usage_spec.rb
contentful-management-2.7.0 spec/lib/contentful/management/api_usage_spec.rb
contentful-management-2.6.0 spec/lib/contentful/management/api_usage_spec.rb