Sha256: 5c101cefc4de6fd31ab2db137d10f68ef24677bf28561d4c0ecbe75eb1f2dba5

Contents?: true

Size: 853 Bytes

Versions: 5

Compression:

Stored size: 853 Bytes

Contents

require "spec_helper"

def mods_display_contents(mods_record)
  ModsDisplay::Contents.new(mods_record, ModsDisplay::Configuration::Base.new, double("controller"))
end

describe ModsDisplay::Contents do
  before(:all) do
    @contents = Stanford::Mods::Record.new.from_str("<mods><tableOfContents>Content Note</tableOfContents></mods>", false).tableOfContents
    @display_label = Stanford::Mods::Record.new.from_str("<mods><tableOfContents displayLabel='Special Label'>Content Note</tableOfContents></mods>", false).tableOfContents
  end
  describe "label" do
    it "should have a default label" do
      mods_display_contents(@contents).label.should == "Table of contents"
    end
    it "should use the displayLabel attribute when one is available" do
      mods_display_contents(@display_label).label.should == "Special Label"
    end
  end  
  
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mods_display-0.2.4 spec/fields/contents_spec.rb
mods_display-0.2.3 spec/fields/contents_spec.rb
mods_display-0.2.2 spec/fields/contents_spec.rb
mods_display-0.2.1 spec/fields/contents_spec.rb
mods_display-0.2.0 spec/fields/contents_spec.rb