Sha256: 5c130023f77844498ceec5c659f3498276b2e759a24441d834d0d0f3f91f58a3

Contents?: true

Size: 987 Bytes

Versions: 3

Compression:

Stored size: 987 Bytes

Contents

require_relative  '../../spec_helper'

describe Syncano::Schema::ResourceDefinition do
  let(:attribute) { double 'attribute' }
  let(:definition) do
    described_class.new(name, attributes: { 'koza' => raw_attribute },
                        associations: {
                          'links' => [{ 'name' => 'koza', 'type' => 'detail' }]
                        })
  end
  let(:name) { 'Kiszka' }
  let(:raw_attribute) { double 'raw attribute' }

  before do
    expect(Syncano::Schema::AttributeDefinition).to receive(:new).with('koza', raw_attribute).and_return(attribute)
  end

  specify { expect(definition.attributes).to eq([attribute]) }

  specify { expect(definition.name).to eq(name) }

  it 'should delete colliding links' do
    expect(definition[:associations]['links']).to be_empty
  end

  describe 'top_level?' do
    context "when is top level" do
      pending "to be done"
    end

    context "when is not top level" do
      pending "to be done"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
syncano-4.0.0.alpha4 spec/unit/schema/resource_definition_spec.rb
syncano-4.0.0.alpha3 spec/unit/schema/resource_definition_spec.rb
syncano-4.0.0.alpha2 spec/unit/schema/resource_definition_spec.rb