Sha256: a8550fa9cb2ba3bf57c8838388072ea29afaa9e1606ce17f6477991b7c4e8cfb

Contents?: true

Size: 981 Bytes

Versions: 25

Compression:

Stored size: 981 Bytes

Contents

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

module Contentful
  module Management
    describe Organization do
      let(:token) { ENV.fetch('CF_TEST_CMA_TOKEN', '<ACCESS_TOKEN>') }
      let!(:client) { Client.new(token) }

      subject { client.organizations }

      describe '.all' do
        it 'fetches the list of organizations belonging to the user' do
          vcr('organization/all') {
            organizations = subject.all
            expect(organizations).to be_a Contentful::Management::Array

            expect(organizations.first).to be_a Contentful::Management::Organization
            expect(organizations.first.name).to eq 'My Test Organization'
            expect(organizations.first.id).to be_truthy
          }
        end
      end

      describe '.find' do
        it 'is not supported' do
          expect { subject.find }.to raise_error 'Not supported'
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
contentful-management-2.12.1 spec/lib/contentful/management/organization_spec.rb
contentful-management-2.12.0 spec/lib/contentful/management/organization_spec.rb
contentful-management-2.11.0 spec/lib/contentful/management/organization_spec.rb
contentful-management-2.10.0 spec/lib/contentful/management/organization_spec.rb
contentful-management-2.9.1 spec/lib/contentful/management/organization_spec.rb
contentful-management-2.9.0 spec/lib/contentful/management/organization_spec.rb
contentful-management-2.8.2 spec/lib/contentful/management/organization_spec.rb
contentful-management-2.8.1 spec/lib/contentful/management/organization_spec.rb
contentful-management-2.8.0 spec/lib/contentful/management/organization_spec.rb
contentful-management-2.7.0 spec/lib/contentful/management/organization_spec.rb
contentful-management-2.6.0 spec/lib/contentful/management/organization_spec.rb
contentful-management-2.5.0 spec/lib/contentful/management/organization_spec.rb
contentful-management-2.4.0 spec/lib/contentful/management/organization_spec.rb
contentful-management-2.3.0 spec/lib/contentful/management/organization_spec.rb
contentful-management-2.2.2 spec/lib/contentful/management/organization_spec.rb
contentful-management-2.2.1 spec/lib/contentful/management/organization_spec.rb
contentful-management-2.2.0 spec/lib/contentful/management/organization_spec.rb
contentful-management-2.1.1 spec/lib/contentful/management/organization_spec.rb
contentful-management-2.1.0 spec/lib/contentful/management/organization_spec.rb
contentful-management-2.0.2 spec/lib/contentful/management/organization_spec.rb