Sha256: 53e2ae4f2ca4fd408057bc909892c08b9c10b4610ba71d30fb06196f7121b78a

Contents?: true

Size: 686 Bytes

Versions: 24

Compression:

Stored size: 686 Bytes

Contents

require 'spec_helper'

RSpec.describe Component, type: :model, components: true do

  it_behaves_like "a DDR model"
  it_behaves_like "an object that can have content"
  it_behaves_like "it has an association", :belongs_to, :parent, :is_part_of, "Item"
  it_behaves_like "it has an association", :belongs_to, :target, :has_external_target, "Target"
  it_behaves_like "a non-collection model"

  describe "indexing" do
    subject { FactoryGirl.build(:component) }
    before do
      allow(subject).to receive(:collection) { Collection.new(pid: "test:1") }
    end
    its(:index_fields) { is_expected.to include(Ddr::Index::Fields::COLLECTION_URI => "info:fedora/test:1") }
  end

end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
ddr-models-2.4.7 spec/models/component_spec.rb
ddr-models-2.4.6 spec/models/component_spec.rb
ddr-models-2.4.5 spec/models/component_spec.rb
ddr-models-2.4.4 spec/models/component_spec.rb
ddr-models-2.4.3 spec/models/component_spec.rb
ddr-models-2.4.2 spec/models/component_spec.rb
ddr-models-2.4.1 spec/models/component_spec.rb
ddr-models-2.4.0 spec/models/component_spec.rb
ddr-models-2.4.0.rc6 spec/models/component_spec.rb
ddr-models-2.4.0.rc5 spec/models/component_spec.rb
ddr-models-2.4.0.rc4 spec/models/component_spec.rb
ddr-models-2.4.0.rc3 spec/models/component_spec.rb
ddr-models-2.4.0.rc2 spec/models/component_spec.rb
ddr-models-2.4.0.rc1 spec/models/component_spec.rb
ddr-models-2.3.2 spec/models/component_spec.rb
ddr-models-2.3.1 spec/models/component_spec.rb
ddr-models-2.3.0 spec/models/component_spec.rb
ddr-models-2.2.0 spec/models/component_spec.rb
ddr-models-2.1.3 spec/models/component_spec.rb
ddr-models-2.1.2 spec/models/component_spec.rb