Sha256: 42b1db4cca671e69b69708318f2fedde03051c0435d5ea1979574627da839db0

Contents?: true

Size: 801 Bytes

Versions: 8

Compression:

Stored size: 801 Bytes

Contents

require 'spec_helper'

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

  let(:resource) { Moysklad::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 Moysklad::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 Moysklad::Entities::CustomEntity
      end

    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
moysklad-0.3.0 spec/lib/moysklad/entities/custom_entity_metadata_spec.rb
moysklad-0.2.1 spec/lib/moysklad/entities/custom_entity_metadata_spec.rb
moysklad-0.2.0 spec/lib/moysklad/entities/custom_entity_metadata_spec.rb
moysklad-0.1.5 spec/lib/moysklad/entities/custom_entity_metadata_spec.rb
moysklad-0.1.4 spec/lib/moysklad/entities/custom_entity_metadata_spec.rb
moysklad-0.1.3 spec/lib/moysklad/entities/custom_entity_metadata_spec.rb
moysklad-0.1.2 spec/lib/moysklad/entities/custom_entity_metadata_spec.rb
moysklad-0.1.1 spec/lib/moysklad/entities/custom_entity_metadata_spec.rb