Sha256: ef06cbc758136a42ea36de659c3923aef5f72accca8e4101b46bd7b187bf55c8

Contents?: true

Size: 1.06 KB

Versions: 12

Compression:

Stored size: 1.06 KB

Contents

require 'spec_helper'

def mods_display_geo(mods_record)
  ModsDisplay::Geo.new(mods_record, ModsDisplay::Configuration::Base.new, double('controller'))
end

describe ModsDisplay::Geo do
  let(:mods) do
    <<-XML
      <mods>
        <extension displayLabel="geo">
          <rdf:RDF xmlns:gml="http://www.opengis.net/gml/3.2/" xmlns:dc="http://purl.org/dc/elements/1.1/">
            <rdf:Description>
              <dc:format>image/tiff; format=ArcGRID</dc:format>
              <dc:type>Dataset#Raster</dc:type>
            </rdf:Description>
          </rdf:RDF>
        </extension>
      </mods>
    XML
  end

  subject do
    mods_display_geo(Stanford::Mods::Record.new.from_str(mods, false).extension).fields
  end

  describe 'labels' do
    it 'is Format' do
      expect(subject.length).to eq(1)
      expect(subject.first.label).to eq('Format:')
    end
  end

  describe 'fields' do
    it 'joins the normalized format and type with a semicolon' do
      expect(subject.length).to eq(1)
      expect(subject.first.values).to eq(['ArcGRID; Raster'])
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
mods_display-0.10.1 spec/fields/geo_spec.rb
mods_display-0.10.0 spec/fields/geo_spec.rb
mods_display-0.9.1 spec/fields/geo_spec.rb
mods_display-0.9.0 spec/fields/geo_spec.rb
mods_display-0.8.0 spec/fields/geo_spec.rb
mods_display-0.7.1 spec/fields/geo_spec.rb
mods_display-0.7.0 spec/fields/geo_spec.rb
mods_display-0.6.0 spec/fields/geo_spec.rb
mods_display-0.5.1 spec/fields/geo_spec.rb
mods_display-0.5.0 spec/fields/geo_spec.rb
mods_display-0.4.1 spec/fields/geo_spec.rb
mods_display-0.4.0 spec/fields/geo_spec.rb