Sha256: 11c30554b573ec54bb0bed6a9fc6e3f96d4a64ccefb2e3c22cc809c43c325795

Contents?: true

Size: 758 Bytes

Versions: 8

Compression:

Stored size: 758 Bytes

Contents

require 'spec_helper'

describe ModsDisplay::Extent do
  let(:mods) do
    <<-XML
      <mods>
        <physicalDescription>
          <extent>Extent Value</extent>
          <extent>Extent Value 2</extent>
        </physicalDescription>
      </mods>
    XML
  end

  subject do
    parsed_mods = Stanford::Mods::Record.new.from_str(mods, false).physical_description
    described_class.new(parsed_mods, ModsDisplay::Configuration::Base.new, double('controller')).fields
  end

  describe 'label' do
    it 'is "Extent"' do
      expect(subject.first.label).to eq 'Extent:'
    end
  end

  describe 'values' do
    it 'returns the text of the extent element' do
      expect(subject.first.values).to eq ['Extent Value', 'Extent Value 2']
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mods_display-0.10.1 spec/fields/extent_spec.rb
mods_display-0.10.0 spec/fields/extent_spec.rb
mods_display-0.9.1 spec/fields/extent_spec.rb
mods_display-0.9.0 spec/fields/extent_spec.rb
mods_display-0.8.0 spec/fields/extent_spec.rb
mods_display-0.7.1 spec/fields/extent_spec.rb
mods_display-0.7.0 spec/fields/extent_spec.rb
mods_display-0.6.0 spec/fields/extent_spec.rb