Sha256: 86da411140c391647bf5b332c9b26fb33614ecad4960edb428b815e445af8063

Contents?: true

Size: 1.63 KB

Versions: 14

Compression:

Stored size: 1.63 KB

Contents

require 'spec_helper'
require 'fixtures/cartographics_fixtures'
include CartographicsFixtures

def mods_display_cartographics(mods)
  ModsDisplay::Cartographics.new(mods, ModsDisplay::Configuration::Base.new, double('controller'))
end

describe ModsDisplay::Cartographics do
  before(:all) do
    @cart = Stanford::Mods::Record.new.from_str(full_cartographic, false).subject
    @scale_only = Stanford::Mods::Record.new.from_str(scale_only, false).subject
    @no_scale = Stanford::Mods::Record.new.from_str(no_scale_cartographic, false).subject
    @coordinates = Stanford::Mods::Record.new.from_str(coordinates_only, false).subject
  end
  describe 'values' do
    it 'should get the full cartographic note' do
      values = mods_display_cartographics(@cart).fields
      expect(values.length).to eq(1)
      expect(values.first.values).to eq(['The scale ; the projection the coordinates'])
    end
    it 'should put a scale not given note if no scale is present' do
      values = mods_display_cartographics(@no_scale).fields
      expect(values.length).to eq(1)
      expect(values.first.values).to eq(['Scale not given ; the projection the coordinates'])
    end
    it 'should handle when there is only a scale note' do
      values = mods_display_cartographics(@scale_only).fields
      expect(values.length).to eq(1)
      expect(values.first.values).to eq(['The scale'])
    end
    it 'should handle when only one post-scale piece of the data is available' do
      values = mods_display_cartographics(@coordinates).fields
      expect(values.length).to eq(1)
      expect(values.first.values).to eq(['Scale not given ; the coordinates'])
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

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