Sha256: 09a3a9d7fd69002a058989144f8ddaaff72a799ca55e8b4beea2dcad16cfeb9d

Contents?: true

Size: 880 Bytes

Versions: 14

Compression:

Stored size: 880 Bytes

Contents

require 'spec_helper'

def mods_display_audience(mods_record)
  ModsDisplay::Audience.new(mods_record, ModsDisplay::Configuration::Base.new, double('controller'))
end

describe ModsDisplay::Contents do
  before(:all) do
    @audience = Stanford::Mods::Record.new.from_str(
      '<mods><targetAudience>Audience Note</targetAudience></mods>', false
    ).targetAudience
    @display_label = Stanford::Mods::Record.new.from_str(
      "<mods><targetAudience displayLabel='Special Label'>Audience Note</tableOfContents></mods>", false
    ).targetAudience
  end
  describe 'label' do
    it 'should have a default label' do
      expect(mods_display_audience(@audience).label).to eq('Target audience:')
    end
    it 'should use the displayLabel attribute when one is available' do
      expect(mods_display_audience(@display_label).label).to eq('Special Label:')
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

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