Sha256: ea59163194316e862fd8cfb9f7440c80d2b53bd9daefda8e2daf82dbd90d438b

Contents?: true

Size: 855 Bytes

Versions: 4

Compression:

Stored size: 855 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

4 entries across 4 versions & 1 rubygems

Version Path
mods_display-0.3.3 spec/fields/contents_spec.rb
mods_display-0.3.2 spec/fields/contents_spec.rb
mods_display-0.3.1 spec/fields/contents_spec.rb
mods_display-0.3.0 spec/fields/contents_spec.rb