Sha256: 98e5e25d7f6b0b24889c4518ab56c8ebae2e57bc857b51bb6d1f99c554a9fb36

Contents?: true

Size: 793 Bytes

Versions: 1

Compression:

Stored size: 793 Bytes

Contents

require 'spec_helper'

describe AmoCRM::Entities::CustomEntityMetadata do
  before do
    stub_rest :CustomEntityMetadata, :list, 0
    stub_rest :CustomEntity, :list, 0
  end

  let(:resource) { AmoCRM::Resources::CustomEntityMetadata.indexed client: client }

  describe do
    let(:custom_entity_metadata) { resource.all.first }

    subject { custom_entity_metadata }

    it do
      expect(subject).to be_a AmoCRM::Entities::CustomEntityMetadata
    end

    it 'unicoded xml' do
      expect(subject.to_xml).to start_with '<?xml version="1.0" encoding="utf-8"?>'
    end

    context 'entities' do

      it do
        expect(subject.entities(universe)).to be_a Array
        expect(subject.entities(universe).first).to be_a AmoCRM::Entities::CustomEntity
      end

    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
amo_crm-0.2.2 spec/lib/amocrm/entities/custom_entity_metadata_spec.rb