Sha256: 869c65002044409bd4168d0d0f843907a81ec6aa77891ee59c87d12f3b3835f1

Contents?: true

Size: 879 Bytes

Versions: 5

Compression:

Stored size: 879 Bytes

Contents

require 'spec_helper'

describe Moysklad::Entities::AttributeMetadata do
  let(:metadata_resource) { Moysklad::Resources::Metadata.indexed client: client }
  let(:subresource) {  metadata_resource.subresource_by_name :GoodFolder }
  let(:attribute_metadata) { subresource.items.first }

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

  context do
    subject { attribute_metadata.dictionatyMetadata universe }
    it do
      expect(subject).to be_a Moysklad::Entities::CustomEntityMetadata
      expect(subject.uuid).to eq attribute_metadata.dictionaryMetadataUuid
    end
  end

  context do
    subject { attribute_metadata.entityMetadata universe }

    it do
      expect(subject).to be_a Moysklad::Entities::EmbeddedEntityMetadata
      expect(subject.uuid).to eq attribute_metadata.entityMetadataUuid
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
moysklad-0.1.5 spec/lib/moysklad/entities/attribute_metadata_spec.rb
moysklad-0.1.4 spec/lib/moysklad/entities/attribute_metadata_spec.rb
moysklad-0.1.3 spec/lib/moysklad/entities/attribute_metadata_spec.rb
moysklad-0.1.2 spec/lib/moysklad/entities/attribute_metadata_spec.rb
moysklad-0.1.1 spec/lib/moysklad/entities/attribute_metadata_spec.rb