Sha256: fdcda03f3d40383b8411c857ed99bf0d7fd09dbca7bb5e4a747dfa2605088bc7

Contents?: true

Size: 1.05 KB

Versions: 21

Compression:

Stored size: 1.05 KB

Contents

require 'spec_helper'
require 'support/structural_metadata_helper'

module Ddr
  module Models
    RSpec.describe Structure, type: :model, structural_metadata: true do

      describe "#struct_maps" do
        let(:structure) { FactoryGirl.build(:multiple_struct_maps_structure) }
        let(:struct_maps) { structure.struct_maps }
        it "should include struct divs for each struct map" do
          expect(struct_maps.keys).to match_array([ 'default', 'reverse' ])
          expect(struct_maps['default']).to be_a(Ddr::Models::StructDiv)
          expect(struct_maps['reverse']).to be_a(Ddr::Models::StructDiv)
        end
      end

      describe "#fptr_nodes" do
        let(:structure) { FactoryGirl.build(:nested_structure) }
        it "should return all fptr nodes" do
          results = structure.fptr_nodes
          expect(results.size).to eq(3)
          ids = results.map { |entry| entry['CONTENTIDS'] }
          expect(ids).to match_array([ 'info:fedora/test:5', 'info:fedora/test:6', 'info:fedora/test:7' ])
        end
      end

    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
ddr-models-2.4.8 spec/models/structure_spec.rb