Sha256: 8e4a8f347c188c69184d17215fd69d231a89db6df391ae1fdb5a5ff3163adca8

Contents?: true

Size: 719 Bytes

Versions: 2

Compression:

Stored size: 719 Bytes

Contents

require 'spec_helper'

describe Moysklad::Entities::CustomEntity do

  before do
    stub_rest :CustomEntityMetadata, :list, 0
    stub_rest :CustomEntity, :list, 0
  end

  let(:resource) { Moysklad::Resources::CustomEntities.indexed client: client }

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

    subject { custom_entity }

    it do
      expect(subject).to be_a Moysklad::Entities::CustomEntity
    end

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

    context 'entityMetadata' do

      it do
        expect(subject.entityMetadata(universe)).to be_a Moysklad::Entities::CustomEntityMetadata
      end

    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
moysklad-0.3.0 spec/lib/moysklad/entities/custom_entity_spec.rb
moysklad-0.2.1 spec/lib/moysklad/entities/custom_entity_spec.rb